ConvertRefcatManager

class lsst.meas.algorithms.ConvertRefcatManager(filenames, config, file_reader, indexer, schema, key_map, htmRange, addRefCatMetadata, log)

Bases: object

Convert a reference catalog from external files into the LSST HTM sharded format, using a multiprocessing Pool to speed up the work.

Parameters:
filenamesdict [int, str]

The HTM pixel id and filenames to convert the catalog into.

configlsst.meas.algorithms.ConvertReferenceCatalogConfig

The Task configuration holding the field names.

file_readerlsst.pipe.base.Task

The file reader to use to load the files.

indexerlsst.meas.algorithms.HtmIndexer

The class used to compute the HTM pixel per coordinate.

schemalsst.afw.table.Schema

The schema of the output catalog.

key_mapdict [str, lsst.afw.table.Key]

The mapping from output field names to keys in the Schema.

htmRangetuple [int]

The start and end HTM pixel ids.

addRefCatMetadatacallable

A function called to add extra metadata to each output Catalog.

loglsst.log.Log

The log to send messages to.

Methods Summary

computeCoord(row, ra_name, dec_name)

Create an ICRS coord.

getCatalog(pixelId, schema, nNewElements)

Get a catalog from disk or create it if it doesn't exist.

run(inputFiles)

Index a set of input files from a reference catalog, and write the output to the appropriate filenames, in parallel.

Methods Documentation

static computeCoord(row, ra_name, dec_name)

Create an ICRS coord. from a row of a catalog being converted.

Parameters:
rownumpy.ndarray

Row from catalog being converted.

ra_namestr

Name of RA key in catalog being converted.

dec_namestr

Name of Dec key in catalog being converted.

Returns:
coordlsst.geom.SpherePoint

ICRS coordinate.

getCatalog(pixelId, schema, nNewElements)

Get a catalog from disk or create it if it doesn’t exist.

Parameters:
pixelIddict

Identifier for catalog to retrieve

schemalsst.afw.table.Schema

Schema to use in catalog creation it does not exist.

nNewElementsint

The number of new elements that will be added to the catalog, so space can be preallocated.

Returns:
cataloglsst.afw.table.SimpleCatalog

The new or read-and-resized catalog specified by dataId.

run(inputFiles)

Index a set of input files from a reference catalog, and write the output to the appropriate filenames, in parallel.

Parameters:
inputFileslist

A list of file paths to read data from.

Returns:
outputdict [int, str]

The htm ids and the filenames that were written to.