GriddedPSFModel

class photutils.psf.GriddedPSFModel(data, *, flux=1.0, x_0=0.0, y_0=0.0, fill_value=0.0)[source]

Bases: ModelGridPlotMixin, Fittable2DModel

A fittable 2D model containing a grid ePSF models.

The ePSF models are defined at fiducial detector locations and are bilinearly interpolated to calculate an ePSF model at an arbitrary (x, y) detector position.

Parameters:
dataNDData

A NDData object containing the grid of reference ePSF arrays. The data attribute must contain a 3D ndarray containing a stack of the 2D ePSFs with a shape of (N_psf, ePSF_ny, ePSF_nx). The meta attribute must be dict containing the following:

  • 'grid_xypos': A list of the (x, y) grid positions of each reference ePSF. The order of positions should match the first axis of the 3D ndarray of ePSFs. In other words, grid_xypos[i] should be the (x, y) position of the reference ePSF defined in data[i].

  • 'oversampling': The integer oversampling factor of the ePSF.

The meta attribute may contain other properties such as the telescope, instrument, detector, and filter of the ePSF.

Methods

read(*args, **kwargs)

Class method to create a GriddedPSFModel instance from a STDPSF FITS file. This method uses stdpsf_reader() with the provided parameters.

Attributes Summary

flux

param_names

Names of the parameters that describe models of this type.

read

Read and parse a STDPSF FITS file into a GriddedPSFModel instance.

x_0

y_0

Methods Summary

clear_cache()

Clear the internal cache.

copy()

Return a copy of this model.

deepcopy()

Return a deep copy of this model.

evaluate(x, y, flux, x_0, y_0)

Evaluate the GriddedPSFModel for the input parameters.

Attributes Documentation

flux = Parameter('flux', value=1.0)
param_names = ('flux', 'x_0', 'y_0')

Names of the parameters that describe models of this type.

The parameters in this tuple are in the same order they should be passed in when initializing a model of a specific type. Some types of models, such as polynomial models, have a different number of parameters depending on some other property of the model, such as the degree.

When defining a custom model class the value of this attribute is automatically set by the Parameter attributes defined in the class body.

read

Read and parse a STDPSF FITS file into a GriddedPSFModel instance.

This class enables the astropy unified I/O layer for GriddedPSFModel. This allows easily reading a file in many supported data formats using syntax such as:

>>> from photutils.psf import GriddedPSFModel
>>> psf_model = GriddedPSFModel.read('STDPSF_ACSWFC_F814W.fits')

Get help on the available readers for GriddedPSFModel using the help() method:

>>> # Get help reading Table and list supported formats
>>> GriddedPSFModel.read.help()

>>> # Get detailed help on the STSPSF FITS reader
>>> GriddedPSFModel.read.help('stdpsf')

>>> # Print list of available formats
>>> GriddedPSFModel.read.list_formats()
Parameters:
*argstuple, optional

Positional arguments passed through to data reader. If supplied the first argument is typically the input filename.

formatstr

File format specifier.

**kwargsdict, optional

Keyword arguments passed through to data reader.

Returns:
outGriddedPSFModel

A gridded ePSF Model corresponding to FITS file contents.

x_0 = Parameter('x_0', value=0.0)
y_0 = Parameter('y_0', value=0.0)

Methods Documentation

clear_cache()[source]

Clear the internal cache.

copy()[source]

Return a copy of this model.

Note that the ePSF grid data is not copied. Use the deepcopy method if you want to copy the ePSF grid data.

deepcopy()[source]

Return a deep copy of this model.

evaluate(x, y, flux, x_0, y_0)[source]

Evaluate the GriddedPSFModel for the input parameters.