exosim.tasks.instrument.loadPsfPaos#

Classes#

LoadPsfPaos

It loads the PSFs from a PAOS file.

Module Contents#

class LoadPsfPaos[source]#

Bases: exosim.tasks.instrument.loadPsf.LoadPsf

It loads the PSFs from a PAOS file. Each PAOS file contains a PSF vs wavelength. The task loads the PSF cube provided by the filename parameter. The PSF are then interpolated over a grid matching the one used to produce the focal planes, to convert them into the physical units. Then the total volume of the interpolated PSF is rescaled to the total volume of the original one. This allow to take into account for loss in the transmission due to the optical path. The PSF are then interpolated over a wavelength grid matching the one used to for the focal plane, producing the cube. Then, the PSF cube is repeated on the temporal axis, because no temporal variation is considered in this Task.

Returns:

cube of psfs. axis=0 is time, axis=1 is wavelength, axis=2 is spatial direction, axis=3 is spectral direction.

Return type:

ndarray

model(filename, parameters, wavelength, time)[source]#
Parameters:
  • filename (str) – PSF input file

  • parameters (dict) – dictionary containing the parameters. This is usually parsed from LoadOptions

  • wavelength (Quantity) – wavelength grid.

Returns:

cube of psfs. axis=0 is time, axis=1 is wavelength, axis=2 is spatial direction, axis=3 is spectral direction.

Return type:

ndarray

static load_wl_sampled(wl, data)[source]#

extract the wavelength from the data stored in the surfaces

Parameters:
  • wl (str) – wavelength

  • data (h5py.File) – opened HDF5 file

Returns:

wavelength

Return type:

float

load_imac(wl, data, parameters, oversampling, delta_pix)[source]#

Returns the PSF interpolated to the detector pixel size. The PSF is normalized to the initial volume after the interpolation.

Parameters:
  • wl (str) – wavelength

  • data (h5py.File) – opened HDF5 file

  • parameters (dict) – detector description

  • oversampling (int) – oversampling factor

  • delta_pix (float or astropy.units.Quantity) – sub-pixel size

Returns:

PSF scaled to physical size

Return type:

numpy.ndarray

crop_image_stack(psf_out, ene=0.99, time_iteration=False)[source]#

It crops the image stack. It takes the PSF for the longest wavelength, as it is expected to be the largest PSF, and then selects the smallest aperture which collect at least the desired ene, using find_rectangular_aperture. Then it remove these area from all the image in the psf data cube.

Parameters:
  • psf_out (numpy.ndarray) – output PSF cube

  • ene (float) – encircled energy desired. Default is 99%.

  • time_iteration (bool) – if time iteration is True then it perform

Returns:

PSF cube cropped

Return type:

numpy.ndarray

static wl_interpolate(psf_cube, wl, wl_sampled)[source]#

This function interpolates the PSF to the desired wavelength grid

Parameters:
Returns:

output PSF cube

Return type:

numpy.ndarray