Coverage for python/lsst/meas/algorithms/ingestIndexReferenceTask.py : 96%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# # LSST Data Management System # # Copyright 2008-2017 AURA/LSST. # # This product includes software developed by the # LSST Project (http://www.lsst.org/). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the LSST License Statement and # the GNU General Public License along with this program. If not, # see <https://www.lsstcorp.org/LegalNotices/>. #
"""!Task runner for the reference catalog ingester
Data IDs are ignored so the runner should just run the task on the parsed command. """
"""!Run the task. Several arguments need to be collected to send on to the task methods.
@param[in] parsedCmd Parsed command including command line arguments. @returns Struct containing the result of the indexing. """
return pipeBase.Struct( result=result, )
dtype=str, default='cal_ref_cat', doc='String to pass to the butler to retrieve persisted files.', ) default='HTM', doc='Name of indexer algoritm to use. Default is HTM', )
dtype=DatasetConfig, doc="Configuration for reading the ingested data", ) target=ReadTextCatalogTask, doc='Task to use to read the files. Default is to expect text files.' ) dtype=str, doc="Name of RA column", ) dtype=str, doc="Name of Dec column", ) dtype=str, doc="The values in the reference catalog are assumed to be in AB magnitudes. " "List of column names to use for photometric information. At least one entry is required." ) keytype=str, itemtype=str, default={}, doc="A map of magnitude column name (key) to magnitude error column (value)." ) dtype=str, optional=True, doc='Name of column stating if satisfactory for photometric calibration (optional).' ) dtype=str, optional=True, doc='Name of column stating if the object is resolved (optional).' ) dtype=str, optional=True, doc='Name of column stating if the object is measured to be variable (optional).' ) dtype=str, optional=True, doc='Name of column to use as an identifier (optional).' ) dtype=str, default=[], doc='Extra columns to add to the reference catalog.' )
raise ValueError("ra_name and dec_name and at least one entry in mag_column_list must be" + " supplied.")
"""!Class for both producing indexed reference catalogs and for loading them.
This implements an indexing scheme based on hierarchical triangular mesh (HTM). The term index really means breaking the catalog into localized chunks called shards. In this case each shard contains the entries from the catalog in a single HTM trixel """
def _makeArgumentParser(cls): """Create an argument parser
This overrides the original because we need the file arguments """
"""!Constructor for the HTM indexing engine
@param[in] butler dafPersistence.Butler object for reading and writing catalogs """ self.config.dataset_config.indexer.active)
"""!Index a set of files comprising a reference catalog. Outputs are persisted in the data repository.
@param[in] files A list of file names to read. """ # persist empty catalog to hold the master schema self.config.dataset_config.ref_dataset_name) dataId=dataId)
def compute_coord(row, ra_name, dec_name): """!Create an ICRS SpherePoint from a np.array row @param[in] row dict like object with ra/dec info in degrees @param[in] ra_name name of RA key @param[in] dec_name name of Dec key @returns ICRS SpherePoint constructed from the RA/Dec values """
"""!Set the flags for a record. Relies on the _flags class attribute @param[in,out] record SourceCatalog record to modify @param[in] row dict like object containing flag info @param[in] key_map Map of catalog keys to use in filling the record """
"""!Set the flux records from the input magnitudes @param[in,out] record SourceCatalog record to modify @param[in] row dict like object containing magnitude values @param[in] key_map Map of catalog keys to use in filling the record """ fluxErrFromABMagErr(row[error_col_name], row[err_key]))
"""!Copy the extra column information to the record @param[in,out] record SourceCatalog record to modify @param[in] row dict like object containing the column values @param[in] key_map Map of catalog keys to use in filling the record """ # If data read from a text file contains string like entires, # numpy stores this as its own internal type, a numpy.str_ # object. This seems to be a consequence of how numpy stores # string like objects in fixed column arrays. This checks # if any of the values to be added to the catalog are numpy # string types, and if they are, casts them to a python string # which is what the python c++ records expect
"""!Fill a record to put in the persisted indexed catalogs
@param[in,out] record afwTable.SourceRecord in a reference catalog to fill. @param[in] row A row from a numpy array constructed from the input catalogs. @param[in] rec_num Starting integer to increment for the unique id @param[in] key_map Map of catalog keys to use in filling the record """ else: # No parents
"""!Get a catalog from the butler or create it if it doesn't exist
@param[in] dataId Identifier for catalog to retrieve @param[in] schema Schema to use in catalog creation if the butler can't get it @returns table (an lsst.afw.table.SourceCatalog) for the specified identifier """
"""!Make the schema to use in constructing the persisted catalogs.
@param[in] dtype A np.dtype to use in constructing the schema @returns a pair of items: - The schema for the output source catalog. - A map of catalog keys to use in filling the record """ not len(mag_column_list) == len(mag_err_column_map) or not sorted(mag_column_list) == sorted(mag_err_column_map.keys())): raise ValueError("Every magnitude column must have a corresponding error column") # makes a schema with a coord, id and parent_id
# dealing with a string like thing. Need to get type and size. else:
|