GriddedPSFModelRead#

class photutils.psf.GriddedPSFModelRead(instance, cls)[source]#

Bases: UnifiedReadWrite

Read and parse a FITS file into a GriddedPSFModel instance.

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

>>> from photutils.psf import GriddedPSFModel
>>> psf_model = GriddedPSFModel.read('filename.fits', format=format)

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')

>>> # Get detailed help on the WebbPSF FITS reader
>>> GriddedPSFModel.read.help('webbpsf')

>>> # Print list of available formats
>>> GriddedPSFModel.read.list_formats()
Parameters:
instanceobject

Descriptor calling instance or None if no instance.

clstype

Descriptor calling class (either owner class or instance class).

The available built-in formats are:
======= ==== ===== =============

Format Read Write Auto-identify

======= ==== ===== =============

stdpsf Yes No Yes

webbpsf Yes No Yes
======= ==== ===== =============

Attributes Summary

registry

Unified I/O registry instance.

Methods Summary

__call__(*args, **kwargs)

Read and parse a FITS file into a GriddedPSFModel instance using the registered "read" function.

help([format, out])

Output help documentation for the specified unified I/O format.

list_formats([out])

Print a list of available formats to console (or out filehandle).

Attributes Documentation

registry#

Unified I/O registry instance.

Methods Documentation

__call__(*args, **kwargs)[source]#

Read and parse a FITS file into a GriddedPSFModel instance using the registered “read” function.

Parameters:
*argstuple

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

**kwargsdict, optional

Keyword arguments passed through to data reader. This includes the format keyword argument.

Returns:
outGriddedPSFModel

A gridded ePSF model corresponding to FITS file contents.

help(format=None, out=None)#

Output help documentation for the specified unified I/O format.

By default the help output is printed to the console via pydoc.pager. Instead one can supplied a file handle object as out and the output will be written to that handle.

Parameters:
formatstr

Unified I/O format name, e.g. ‘fits’ or ‘ascii.ecsv’

outNone or file-like

Output destination (default is stdout via a pager)

list_formats(out=None)#

Print a list of available formats to console (or out filehandle).

outNone or file handle object

Output destination (default is stdout via a pager)