webbpsf_ext.psfs.gen_image_from_coeff

webbpsf_ext.psfs.gen_image_from_coeff(inst, coeff, coeff_hdr, sp_norm=None, nwaves=None, use_sp_waveset=False, return_oversample=False)[source]

Generate PSF

Create an image (direct, coronagraphic, grism, or DHS) based on a set of instrument parameters and PSF coefficients. The image is noiseless and doesn’t take into account any non-linearity or saturation effects, but is convolved with the instrument throughput. Pixel values are in counts/sec. The result is effectively an idealized slope image.

If no spectral dispersers, then this returns a single image or list of images if sp_norm is a list of spectra.

Parameters
  • coeff (ndarray) – A cube of polynomial coefficients for generating PSFs. This is generally oversampled with a shape (fov_pix*oversamp, fov_pix*oversamp, deg).

  • coeff_hdr (FITS header) – Header information saved while generating coefficients.

  • sp_norm (pysynphot.spectrum) – A normalized Pysynphot spectrum to generate image. If not specified, the default is flat in phot lam (equal number of photons per spectral bin). The default is normalized to produce 1 count/sec within that bandpass, assuming the telescope collecting area. Coronagraphic PSFs will further decrease this flux.

  • nwaves (int) – Option to specify the number of evenly spaced wavelength bins to generate and sum over to make final PSF. Useful for wide band filters with large PSFs over continuum source.

  • use_sp_waveset (bool) – Set this option to use sp_norm waveset instead of bandpass waveset. Useful if user inputs a high-resolution spectrum with line emissions, so may wants to keep a grism PSF (for instance) at native resolution rather than blurred with the bandpass waveset. TODO: Test.

  • return_oversample (bool) – If True, then instead returns the oversampled version of the PSF.

Keyword Arguments
  • grism_order (int) – Grism spectral order (default=1).

  • ND_acq (bool) – ND acquisition square in coronagraphic mask.