psfsim.polychrom

Functions for polychromatic PSFs.

Classes

PolychromaticPSF

Compute and draw weighted polychromatic PSFs.

Functions

inBandpass(wav, filter_string, bandpasses)

Compute whether a wavelength is in a filter.

Module Contents

inBandpass(wav, filter_string, bandpasses)[source]

Compute whether a wavelength is in a filter.

Parameters:
  • wav (float) – Wavelength in microns

  • filter_string (str) – String to identify the filter. Can either be just a letter or letter + wl (e.g. ‘H’ or ‘H158’).

  • bandpasses (dict) – Dictionary of GalSim Roman bandpasses, typically from galsim.roman.getBandpasses().

Returns:

Whether the wavelength is in the filter, and the galsim key of the filter if it is in the bandpass.

Return type:

bool, str

class PolychromaticPSF(scanum, scax, scay, wavelengths, sed=None)[source]

Compute and draw weighted polychromatic PSFs.

Parameters:
  • scanum (int) – Roman SCA index passed through to PSFObject.

  • scax (float) – Source x-position on the SCA, in mm.

  • scay (float) – Source y-position on the SCA, in mm.

  • wavelengths (array-like) – Wavelength samples in microns. Values are evaluated in the provided order.

  • sed (callable, optional) – Spectral energy distribution weight function evaluated as sed(wav_microns). This should be in units proportional to photons/m^2/s/micron. If None, a flat spectral weight (in lambda F_lambda) is assumed.

scanum[source]
scax[source]
scay[source]
wavelengths[source]
sed = None[source]
bandpass[source]
compute_poly_psf(postage_stamp_size=31, ovsamp=10, use_filter='H', npix_boundary=1, use_postage_stamp_size=None, ray_trace=True, add_focus=None, optical_psf_only=False, req_in_bandpass=True, cycle=9, mjd=None)[source]

Compute the polychromatic PSF by integrating monochromatic PSFs across wavelength.

Integration uses a trapezoidal rule over the caller-provided wavelength nodes (internally sorted). Out-of-band nodes contribute zero. If exactly one node is in-band, this returns the corresponding monochromatic PSF.

Parameters:
  • postage_stamp_size (int, optional) – Size of the postage stamp to draw, in native pixels.

  • ovsamp (int, optional) – The number of samples per native pixel on each axis.

  • use_filter (str, optional) – The filter as a string (e.g., “H”).

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

  • npix_boundary (int, optional) –

    ?

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

  • add_focus (variable) – Parameter for adding focus.

  • optical_psf_only (bool, optional) – Whether to draw the optical PSF only.

  • req_in_bandpass (bool, optional) – Whether to only accept in-band light (turning this on will make things faster for some settings, but will miss detail in the PSF from out-of-band leakage). Recommend True for fast computation, False for best accuracy.

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

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

Returns:

The polychromatic PSF as a 2D numpy array.

Return type:

np.ndarray