ReadFitsCatalogTask

ReadFitsCatalogTask reads an object catalog from a FITS file into a numpy array object suitable for use with lsst.meas.algorithms.IngestIndexReferenceTask.

Python API summary

from lsst.meas.algorithms.readFitsCatalogTask import ReadFitsCatalogTask
classReadFitsCatalogTask(config=None, name=None, parentTask=None, log=None)

Read an object catalog from a FITS table...

attributeconfig

Access configuration fields and retargetable subtasks.

methodrun(filename)

Read an object catalog from the specified FITS file...

See also

See the ReadFitsCatalogTask API reference for complete details.

Retargetable subtasks

No subtasks.

Configuration fields

column_map

Default
{}
Field type

DictField

Key type

str

Value type

str

Mapping of input column name: output column name; each specified column must exist, but additional columns in the input data are written using their original name.

hdu

Default
1
Field type

int Field

HDU containing the desired binary table, 0-based but a binary table never occurs in HDU 0

Examples

A complete example of using ReadFitsCatalogTask:

from lsst.meas.algorithms.readFitsCatalogTask import ReadFitsCatalogTask
filePath = "tests/data/testReadFitsCatalog.fits"
task = ReadFitsCatalogTask()
catalogArray = task.run(filePath)

The resulting catalogArray is a numpy structured array containing fields such as “name”, “ra” and “dec” and a few rows of data. For more complicated cases config parameters allow you to rename columns and choose which HDU to read.