photutils.psf.stdpsf_reader(filename, detector_id=None)[source]

Generate a GriddedPSFModel from a STScI standard-format ePSF (STDPSF) FITS file.


Instead of being used directly, this function is intended to be used via the GriddedPSFModel read method, e.g., model =, format='stdpsf').

STDPSF files are FITS files that contain a 3D array of ePSFs with the header detailing where the fiducial ePSFs are located in the detector coordinate frame.

The oversampling factor for STDPSF FITS files is assumed to be 4.


The name of the STDPDF FITS file. A URL can also be used.

detector_idNone or int, optional

For STDPSF files that contain ePSF grids for multiple detectors, one will need to identify the detector for which to extract the ePSF grid. This keyword is ignored for STDPSF files that do not contain ePSF grids for multiple detectors.

For WFPC2, the detector value (int) should be:

  • 1: PC, 2: WF2, 3: WF3, 4: WF4

For ACS/WFC and WFC3/UVIS, the detector value should be:

  • 1: WFC2, UVIS2 (sci, 1)

  • 2: WFC1, UVIS1 (sci, 2)

Note that for these two instruments, detector 1 is above detector 2 in the y direction. However, in the FLT FITS files, the (sci, 1) extension corresponds to detector 2 (WFC2, UVIS2) and the (sci, 2) extension corresponds to detector 1 (WFC1, UVIS1).

For NIRCam NRCSW files that contain ePSF grids for all 8 SW detectors, the detector value should be:

  • 1: A1, 2: A2, 3: A3, 4: A4

  • 5: B1, 6: B2, 7: B3, 8: B4


The gridded ePSF model.