exorad.utils.exolib module

OmegaPix(Fnum_x, Fnum_y=None)[source]

Calculate the solid angle subtended by an elliptical aperture on-axis. Algorithm from “John T. Conway. Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment, 614(1):17 ? 27, 2010. https://doi.org/10.1016/j.nima.2009.11.075 Equation n. 56

Parameters:
  • Fnum_x (scalar) – Input F-number along dispersion direction

  • Fnum_y (scalar) – Optional, input F-number along cross-dispersion direction

Returns:

Omega – The solid angle subtanded by an elliptical aperture in units u.sr

Return type:

scalar

binnedPSF(F_x, F_y, wl, delta_pix, filename=None, format=None, PSFtype='AIRY', plot=False)[source]
encircled_energy(r, ima, Fnum_x, Fnum_y, wavelength)[source]
find_aperture_radius(ima, eec, Fnum_x, Fnum_y, wavelength)[source]

It finds the aperture radius for a given PSF such that the desired Encircled Energy is contained.

Parameters:
  • ima – psf image in micron scale

  • eec – desired encircled energy

  • Fnum_x – f number in the spectral direction

  • Fnum_y – f number in the spatial direction

  • wavelength – wavelength of the sampled psf

Return type:

float

interpolate_paos_psf(fd, wl)[source]
load_paos_psf(wl_group)[source]
load_pixel_psf_size(delta_pix, hdr)[source]
load_standard_psf(F_x, F_y, wl, delta_pix, hdr)[source]
paosPSF(wl, delta_pix, filename='', plot=False)[source]
pixel_based_psf(wl, delta_pix, filename)[source]
planck(wl, T)[source]

Planck function.

Parameters:
  • wl (array) – wavelength [micron]

  • T (scalar) – Temperature [K] Spot temperature [K]

Returns:

spectrum – The Planck spectrum [W m^-2 sr^-1 micron^-1]

Return type:

array

plot_imac(imac, extent, xlim=None, ylim=None)[source]
rebin(x, xp, fp)[source]

Resample a function fp(xp) over the new grid x, rebinning if necessary, otherwise interpolates :param x: :type x: array like :param New coordinates: :param fp: :type fp: array like :param y-coordinates to be resampled: :param xp: :type xp: array like :param x-coordinates at which fp are sampled:

Returns:

  • out (array like)

  • new samples

rebin_(x, xp, fp)[source]

Resample a function fp(xp) over the new grid x, rebinning if necessary, otherwise interpolates :param x: :type x: array like :param New coordinates: :param fp: :type fp: array like :param y-coordinates to be resampled: :param xp: :type xp: array like :param x-coordinates at which fp are sampled:

Returns:

  • out (array like)

  • new samples

wl_encircled_energy(filename, eec, format, Fnum_x, Fnum_y, delta_pix)[source]