MultiMatch

class lsst.afw.table.MultiMatch(schema, dataIdFormat, coordField='coord', idField='id', radius=None, RecordClass=<class 'lsst.afw.table.SourceRecord'>)

Bases: object

Initialize a multi-catalog match.

Parameters
schemalsst.afw.table.Schema

Schema shared by all catalogs to be included in the match.

dataIdFormatdict

Set of name: type for all data ID keys (e.g. {“visit”:int, “ccd”:int}).

coordFieldstr, optional

Prefix for _ra and _dec fields that contain the coordinates to use for the match.

idFieldstr, optional

Name of the field in schema that contains unique object IDs.

radiuslsst.geom.Angle, optional

Maximum separation for a match. Defaults to 0.5 arcseconds.

RecordClasslsst.afw.table.BaseRecord

Type of record to expect in catalogs to be matched.

Methods Summary

add(catalog, dataId)

Add a new catalog to the match, corresponding to the given data ID.

finish([removeAmbiguous])

Return the final match catalog, after sorting it by object, copying it to ensure contiguousness, and optionally removing ambiguous matches.

makeRecord(inputRecord, dataId, objId)

Create a new result record from the given input record, using the given data ID and object ID to fill in additional columns.

Methods Documentation

add(catalog, dataId)

Add a new catalog to the match, corresponding to the given data ID. The new catalog is appended to the self.result and self.reference catalogs.

Parameters
cataloglsst.afw.table.base.Catalog

Catalog to be added to the match result.

dataIdDataId or dict

Data id for the catalog to be added.

finish(removeAmbiguous=True)

Return the final match catalog, after sorting it by object, copying it to ensure contiguousness, and optionally removing ambiguous matches.

After calling finish(), the in-progress state of the matcher is returned to the state it was just after construction, with the exception of the object ID counter (which is not reset).

Parameters
removeAmbiguousbool, optional

Should ambiguous matches be removed from the match catalog? Defaults to True.

Returns
resultlsst.afw.table.base.Catalog

Final match catalog, sorted by object.

makeRecord(inputRecord, dataId, objId)

Create a new result record from the given input record, using the given data ID and object ID to fill in additional columns.

Parameters
inputRecordlsst.afw.table.source.sourceRecord

Record to use as the reference for the new result.

dataIdDataId or dict

Data id describing the data.

objIdint

Object id of the object to be added.

Returns
outputRecordlsst.afw.table.source.sourceRecord

Newly generated record.