psfsim.psfobject

Attributes

c

epsilon_0

def parallel_MTF_image(args):

Classes

PSFObject

Monochromatic PSF object class.

Module Contents

c = 299792458.0[source]
epsilon_0 = 8.8541878188e-12[source]

def parallel_MTF_image(args): “””Wrapper for MTF_image”””

xd, yd, imageX, imageY, Intensity_integrated, npix_boundary = args return MTF_image(xd, yd, imageX, imageY, Intensity_integrated, npix_boundary)

class PSFObject(scanum, scax, scay, wavelength=0.48, postage_stamp_size=31, ovsamp=10, use_filter='H', npix_boundary=1, a_lanczos=3, use_postage_stamp_size=None, ray_trace=True, add_focus=None, detector_thickness=2, zlen=20, interference_filter=None, cycle=9, mjd=None)[source]

Monochromatic PSF object class.

Parameters:
  • scanum (int) – The SCA number.

  • scax (float) – The pixel positions on the SCA (in mm, FPA coordinates relative to the SCA center).

  • scay (float) – The pixel positions on the SCA (in mm, FPA coordinates relative to the SCA center).

  • wavelength (float, optional) – The vacuum wavelength in microns.

  • postage_stamp_size (int, optional) – The length of the side of the square postage stamp in native pixels.

  • ovsamp (int, optional) – The oversampling factor for the PSF (number of samples per native pixel).

  • use_filter (str, optional) – The filter configuration to use (1-character code).

  • npix_boundary (int, optional) –

    ?

  • use_postage_stamp_size (int, optional) – Force pupil postage stamp size instead of internal calculation. In native pixels.

  • ray_trace (bool, optional) – Whether to use ray tracing. (Only turn off for testing.)

  • add_focus (variable) – Parameter for adding focus.

  • detector_thickness (float, optional) – Thickness of the detector in microns. This is used to compute the electric field and intensity within the detector.

  • zlen (int, optional) – Number of points along the z-axis (depth) within the detector to compute the electric field and intensity. This is used to compute the electric field and intensity within the detector.

  • interference_filter (psfsim.filter_detector_properties.FilterDetector, optional) –

    The interference filter object to use for computing the transmitted electric field and intensity within the detector. Defaults to an ideal 3-layer interference filter (to get the right wiggle shape) + thin layer of CdTe/HgCdTe (to give the additional loss in the blue).

    Note that if you really want to model the response of each SCA, you will need some additional empirical corrections on top of this, both because there are thickness variations and also because there is a lot of physics associated with whether you get electrons absorbed right near the illuminated surface that we aren’t modeling — we’re just using a 2-layer “dead zone” with ideal materials to mock up what is probably a region with varying band gap and probability of collecting the hole that gets released.

  • cycle (int, optional) – Which cycle to use for the Zernike modes.

  • mjd (float, optional) – The MJD to use for the optical model.

wavelength[source]

The wavelength

Type:

float

interference_filter[source]

The interference filter object.

Type:

psfsim.filter_detector_properties.FilterDetector

ulen[source]

The length of the FFTs.

Type:

int

optics[source]

The Geometric Optics object.

Type:

psfsim.opticspsf.GeometricOptics

__init__()[source]

Constructor.

get_optical_psf()[source]

Gets the optical PSF (no detector effects).

wavelength = 0.48[source]
npix_boundary = 1[source]
interference_filter = None[source]
postage_stamp_size = 31[source]
detector_thickness = 2[source]
z_array[source]
ovsamp = 10[source]
ulen = 2048[source]
optics[source]
u[source]
mask[source]
dx[source]
prefactor[source]
get_optical_psf(normalise=True)[source]

Gets the optical PSF (no detector effects).

Returns values of the optical PSF on the SCA surface in the postage stamp surrounding the point (SCAx, SCAy) in the SCA. This function is added for testing purposes and to assess the impact of the interference filter on the PSF and charge diffusion through the HgCdTe layer. Note that the optical PSF includes the effects of diffraction and pupil mask and is normalized to total discrete flux of 1 when normalise is True. The optical psf is saved to self.Optical_PSF.

Parameters:

normalise (bool, optional) – Currently has no effect.

get_Intensity_in_detector(nworkers=8)[source]

Gets the total intensity of the h-polarised and v-polarised E-fields in the detector, integrated over the depth of the detector, after the optical PSF has been computed

Parameters:

nworkers (int, optional) – The number of workers to use for parallel processing when computing the intensity in the detector. This is used in the get_Intensity_from_E function which is called within this function.

get_Intensity_from_E(A_TE=10000000000.0, A_TM=10000000000.0, nworkers=8)[source]

Gets the intensity from the electric field amplitudes in TE and TM modes. This is used to get the intensity in the detector after passing through the interference filter.

Uses adaptive Gaussian quadrature integration optimized for exponential decay in the HgCdTe detector material, replacing the previous trapezoid rule.

Parameters:
  • A_TE (np.ndarray of complex of shape same as ux and uy) – The TE mode amplitude.

  • A_TM (np.ndarray of complex of shape same as ux and uy) – The TM mode amplitude.

  • nworkers (int, optional) – The number of workers to use for parallel processing when computing the inverse fourier transforms of the E-field from wave-number space to FPA postage stamp coordinates.

Returns:

Intensity_integrated – The intensity in the detector, integrated over the depth of the detector, after passing through the interference filter, using adaptive Gaussian quadrature.

Return type:

np.ndarray of float of shape same as ux and uy

get_image_from_Intensity(centerpix=True, reflect=True, tophat=True)[source]

Gets the image on the detector from the intensity in the detector by convolving with the MTF of charge diffusion in the HgCdTe layer. This is used to get the final PSF image on the detector after including the effects of charge diffusion.

Parameters:
  • centerpix (bool, optional) – Whether to center the PSF on a pixel.

  • reflect (bool, optional) – Whether to reflect the PSF.

  • tophat (bool, optional) – Whether to use a tophat function.

  • oversampling (int, optional) – The oversampling factor.

Returns:

detector_image – The final PSF image on the detector after including the effects of charge diffusion.

Return type:

np.ndarray of float of shape (postage_stamp_size, postage_stamp_size)