JWST POPPY:docs

Instrument

class poppy.Instrument(name='', *args, **kwargs)[source] [edit on github]

Bases: object

A generic astronomical instrument, composed of
  1. an optical system implemented using POPPY, optionally with several configurations such as selectable image plane or pupil plane stops, and
  2. some defined spectral bandpass(es) such as selectable filters, implemented using pysynphot.

This provides the capability to model both the optical and spectral responses of a given system. PSFs may be calculated for given source spectral energy distributions and output as FITS files, with substantial flexibility.

It also provides capabilities for modeling some PSF effects not due to wavefront aberrations, for instance blurring caused by pointing jitter.

This is a base class for Instrument functionality - you cannot easily use this directly, but rather should subclass it for your particular instrument of interest. Some of the complexity of this class is due to splitting up functionality into many separate routines to allow users to subclass just the relevant portions for a given task. There’s a fair amount of functionality here but the learning curve is steeper than elsewhere in POPPY.

You will at a minimum want to override the following class methods:

_getOpticalSystem _getFilterList _getDefaultNLambda _getDefaultFOV _getFITSHeader
For more complicated systems you may also want to override:
_validateConfig _getSynphotBandpass _applyJitter

Attributes Summary

filter Currently selected filter name (e.g.

Methods Summary

calcPSF([outfile, source, nlambda, ...]) Compute a PSF.
display() Display the currently configured optical system on screen

Attributes Documentation

filter

Currently selected filter name (e.g. “F200W”)

Methods Documentation

calcPSF(outfile=None, source=None, nlambda=None, monochromatic=None, fov_arcsec=None, fov_pixels=None, oversample=None, detector_oversample=None, fft_oversample=None, rebin=True, clobber=True, display=False, save_intermediates=False, return_intermediates=False)[source] [edit on github]

Compute a PSF. The result can either be written to disk (set outfile=”filename”) or else will be returned as a FITS HDUlist object.

Output sampling may be specified in one of two ways:

  1. Set oversample=. This will use that oversampling factor beyond detector pixels for output images, and beyond Nyquist sampling for any FFTs to prior optical planes.
  2. set detector_oversample= and fft_oversample=. This syntax lets you specify distinct oversampling factors for intermediate and final planes.

By default, both oversampling factors are set equal to 2.

Parameters :

source : pysynphot.SourceSpectrum or dict

specification of source input spectrum. Default is a 5700 K sunlike star.

nlambda : int

How many wavelengths to model for broadband? The default depends on how wide the filter is: (5,3,1) for types (W,M,N) respectively

monochromatic : float, optional

Setting this to a wavelength value (in meters) will compute a monochromatic PSF at that wavelength, overriding filter and nlambda settings.

fov_arcsec : float

field of view in arcsec. Default=5

fov_pixels : int

field of view in pixels. This is an alternative to fov_arcsec.

outfile : string

Filename to write. If None, then result is returned as an HDUList

oversample, detector_oversample, fft_oversample : int

How much to oversample. Default=4. By default the same factor is used for final output pixels and intermediate optical planes, but you may optionally use different factors if so desired.

rebin : bool, optional

If set, the output file will contain a FITS image extension containing the PSF rebinned onto the actual detector pixel scale. Thus, setting oversample=<N> and rebin=True is the proper way to obtain high-fidelity PSFs computed on the detector scale. Default is True.

clobber : bool

overwrite output FITS file if it already exists?

display : bool

Whether to display the PSF when done or not.

save_intermediates, return_intermediates : bool

Options for saving to disk or returning to the calling function the intermediate optical planes during the propagation. This is useful if you want to e.g. examine the intensity in the Lyot plane for a coronagraphic propagation.

Returns :

outfits : fits.HDUList

The output PSF is returned as a fits.HDUlist object. If outfile is set to a valid filename, the output is also written to that file.

Notes

More advanced PSF computation options (pupil shifts, source positions, jitter, ...) may be set by configuring the options dictionary attribute of this class.

display()[source] [edit on github]

Display the currently configured optical system on screen

Page Contents