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:
- data
NDData
A
NDData
object containing the grid of reference ePSF arrays. The data attribute must contain a 3Dndarray
containing a stack of the 2D ePSFs with a shape of(N_psf, ePSF_ny, ePSF_nx)
. The meta attribute must bedict
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 3Dndarray
of ePSFs. In other words,grid_xypos[i]
should be the (x, y) position of the reference ePSF defined indata[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.
- data
Methods
read(*args, **kwargs)
Class method to create a
GriddedPSFModel
instance from a STDPSF FITS file. This method usesstdpsf_reader()
with the provided parameters.Attributes Summary
Names of the parameters that describe models of this type.
Read and parse a STDPSF FITS file into a
GriddedPSFModel
instance.Methods Summary
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 thehelp()
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:
- out
GriddedPSFModel
A gridded ePSF Model corresponding to FITS file contents.
- out
- x_0 = Parameter('x_0', value=0.0)¶
- y_0 = Parameter('y_0', value=0.0)¶
Methods Documentation
- 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.
- evaluate(x, y, flux, x_0, y_0)[source]¶
Evaluate the
GriddedPSFModel
for the input parameters.