lsst.meas.algorithms
20.0.0-7-gc818c6e6+492b1d82d4
|
Read an object catalog from a text file. More...
Public Member Functions | |
def | run (self, filename) |
Static Public Attributes | |
ConfigClass = ReadTextCatalogConfig | |
Read an object catalog from a text file.
Read an object catalog from a text file. Designed to read foreign catalogs so they can be written out in a form suitable for IngestIndexedReferenceTask.
The file is assumed to be encoded as UTF-8 (which is compatible with ASCII).
Given a file named table.csv
containing the following:
ra, dec, flux 5.5, -45.2, 12453 19.6, 34.2, 32123
you can read this file with the following code:
from lsst.meas.algorithms.readTextCatalogTask import ReadTextCatalogTask task = ReadTextCatalogTask() catalogArray = task.run("table.csv")
The resulting catalogArray
is a numpy structured array containing three fields ("ra", "dec" and "flux") and two rows of data. For more complex cases, config parameters allow you to specify the names of the columns (instead of using automatic discovery) and set the number of rows to skip.
Definition at line 66 of file readTextCatalogTask.py.
def lsst.meas.algorithms.readTextCatalogTask.ReadTextCatalogTask.run | ( | self, | |
filename | |||
) |
Read an object catalog from the specified text file @param[in] filename path to text file @return a numpy structured array containing the specified columns
Definition at line 115 of file readTextCatalogTask.py.
|
static |
Definition at line 113 of file readTextCatalogTask.py.