lsst.meas.algorithms
14.0-16-g5f38f6f3
|
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.
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 60 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 107 of file readTextCatalogTask.py.
|
static |
Definition at line 105 of file readTextCatalogTask.py.