lsst.meas.base
14.0-9-g876143c+5
|
A subtask for measuring the properties of sources on a single exposure, using an existing "reference" catalog to constrain some aspects of the measurement. More...
Public Member Functions | |
def | __init__ (self, refSchema, algMetadata=None, kwds) |
Initialize the task. More... | |
def | run (self, measCat, exposure, refCat, refWcs, exposureId=None, beginOrder=None, endOrder=None) |
Perform forced measurement. More... | |
def | generateMeasCat (self, exposure, refCat, refWcs, idFactory=None) |
Initialize an output SourceCatalog using information from the reference catalog. More... | |
def | attachTransformedFootprints (self, sources, refCat, exposure, refWcs) |
Default implementation for attaching Footprints to blank sources prior to measurement. More... | |
def | getPluginLogName (self, pluginName) |
def | initializePlugins (self, kwds) |
def | callMeasure (self, measRecord, args, kwds) |
Call the measure() method on all plugins, handling exceptions in a consistent way. More... | |
def | doMeasurement (self, plugin, measRecord, args, kwds) |
Call the measure() method on the nominated plugin, handling exceptions in a consistent way. More... | |
def | callMeasureN (self, measCat, args, kwds) |
Call the measureN() method on all plugins, handling exceptions in a consistent way. More... | |
def | doMeasurementN (self, plugin, measCat, args, kwds) |
Call the measureN() method on the nominated plugin, handling exceptions in a consistent way. More... | |
Public Attributes | |
mapper | |
schema | |
plugins | |
undeblendedPlugins | |
algMetadata | |
Static Public Attributes | |
ConfigClass = ForcedMeasurementConfig | |
A subtask for measuring the properties of sources on a single exposure, using an existing "reference" catalog to constrain some aspects of the measurement.
The task is configured with a list of "plugins": each plugin defines the values it measures (i.e. the columns in a table it will fill) and conducts that measurement on each detected source (see ForcedPlugin). The job of the measurement task is to initialize the set of plugins (which includes setting up the catalog schema) from their configuration, and then invoke each plugin on each source.
Most of the time, ForcedMeasurementTask will be used via one of the subclasses of ForcedPhotImageTask, ForcedPhotCcdTask and ForcedPhotCoaddTask. These combine this measurement subtask with a "references" subtask (see BaseReferencesTask and CoaddSrcReferencesTask) to perform forced measurement using measurements performed on another image as the references. There is generally little reason to use ForcedMeasurementTask outside of one of these drivers, unless it is necessary to avoid using the Butler for I/O.
ForcedMeasurementTask has only three methods: init(), run(), and generateMeasCat(). For configuration options, see SingleFrameMeasurementConfig.
Definition at line 194 of file forcedMeasurement.py.
def lsst.meas.base.forcedMeasurement.ForcedMeasurementTask.__init__ | ( | self, | |
refSchema, | |||
algMetadata = None , |
|||
kwds | |||
) |
Initialize the task.
Set up the execution order of the plugins and initialize the plugins, giving each plugin an opportunity to add its measurement fields to the output schema and to record information in the task metadata.
Note that while SingleFrameMeasurementTask is passed an initial Schema that is appended to in order to create the output Schema, ForcedMeasurementTask is initialized with the Schema of the reference catalog, from which a new Schema for the output catalog is created. Fields to be copied directly from the reference Schema are added before Plugin fields are added.
[in] | refSchema | Schema of the reference catalog. Must match the catalog later passed to generateMeasCat() and/or run(). |
[in,out] | algMetadata | lsst.daf.base.PropertyList used to record information about each algorithm. An empty PropertyList will be created if None. |
[in] | **kwds | Keyword arguments passed from lsst.pipe.base.Task.__init__ |
Definition at line 223 of file forcedMeasurement.py.
def lsst.meas.base.forcedMeasurement.ForcedMeasurementTask.attachTransformedFootprints | ( | self, | |
sources, | |||
refCat, | |||
exposure, | |||
refWcs | |||
) |
Default implementation for attaching Footprints to blank sources prior to measurement.
Footprints for forced photometry must be in the pixel coordinate system of the image being measured, while the actual detections may start out in a different coordinate system. This default implementation transforms the Footprints from the reference catalog from the refWcs to the exposure's Wcs, which downgrades HeavyFootprints into regular Footprints, destroying deblend information.
Note that ForcedPhotImageTask delegates to this method in its own attachFootprints method. attachFootprints can then be overridden by its subclasses to define how their Footprints should be generated.
See the documentation for run() for information about the relationships between run(), generateMeasCat(), and attachTransformedFootprints().
Definition at line 382 of file forcedMeasurement.py.
|
inherited |
Call the measure() method on all plugins, handling exceptions in a consistent way.
[in,out] | measRecord | lsst.afw.table.SourceRecord that corresponds to the object being measured, and where outputs should be written. |
[in] | *args | Positional arguments forwarded to Plugin.measure() |
[in] | **kwds | Keyword arguments. Two are handled locally:
|
This method can be used with plugins that have different signatures; the only requirement is that 'measRecord' be the first argument. Subsequent positional arguments and keyword arguments are forwarded directly to the plugin.
This method should be considered "protected"; it is intended for use by derived classes, not users.
Definition at line 255 of file baseMeasurement.py.
|
inherited |
Call the measureN() method on all plugins, handling exceptions in a consistent way.
[in,out] | measCat | lsst.afw.table.SourceCatalog containing records for just the source family to be measured, and where outputs should be written. |
[in] | beginOrder | beginning execution order (inclusive): measurements with executionOrder < beginOrder are not executed. None for no limit. |
[in] | endOrder | ending execution order (exclusive): measurements with executionOrder >= endOrder are not executed. None for no limit. |
[in] | *args | Positional arguments forwarded to Plugin.measure() |
[in] | **kwds | Keyword arguments. Two are handled locally:
|
This method can be used with plugins that have different signatures; the only requirement is that 'measRecord' be the first argument. Subsequent positional arguments and keyword arguments are forwarded directly to the plugin.
This method should be considered "protected"; it is intended for use by derived classes, not users.
Definition at line 315 of file baseMeasurement.py.
|
inherited |
Call the measure() method on the nominated plugin, handling exceptions in a consistent way.
[in] | plugin | Plugin that will measure |
[in,out] | measRecord | lsst.afw.table.SourceRecord that corresponds to the object being measured, and where outputs should be written. |
[in] | *args | Positional arguments forwarded to plugin.measure() |
[in] | **kwds | Keyword arguments forwarded to plugin.measure() |
This method can be used with plugins that have different signatures; the only requirement is that the 'plugin' and 'measRecord' be the first two arguments. Subsequent positional arguments and keyword arguments are forwarded directly to the plugin.
This method should be considered "protected"; it is intended for use by derived classes, not users.
Definition at line 284 of file baseMeasurement.py.
|
inherited |
Call the measureN() method on the nominated plugin, handling exceptions in a consistent way.
[in] | plugin | Plugin that will measure |
[in,out] | measCat | lsst.afw.table.SourceCatalog containing records for just the source family to be measured, and where outputs should be written. |
[in] | *args | Positional arguments forwarded to plugin.measureN() |
[in] | **kwds | Keyword arguments forwarded to plugin.measureN() |
This method can be used with plugins that have different signatures; the only requirement is that the 'plugin' and 'measCat' be the first two arguments. Subsequent positional arguments and keyword arguments are forwarded directly to the plugin.
This method should be considered "protected"; it is intended for use by derived classes, not users.
Definition at line 349 of file baseMeasurement.py.
def lsst.meas.base.forcedMeasurement.ForcedMeasurementTask.generateMeasCat | ( | self, | |
exposure, | |||
refCat, | |||
refWcs, | |||
idFactory = None |
|||
) |
Initialize an output SourceCatalog using information from the reference catalog.
This generates a new blank SourceRecord for each record in refCat. Note that this method does not attach any Footprints. Doing so is up to the caller (who may call attachedTransformedFootprints or define their own method - see run() for more information).
[in] | exposure | Exposure to be measured |
[in] | refCat | Sequence (not necessarily a SourceCatalog) of reference SourceRecords. |
[in] | refWcs | Wcs that defines the X,Y coordinate system of refCat |
[in] | idFactory | factory for creating IDs for sources |
Definition at line 355 of file forcedMeasurement.py.
|
inherited |
Definition at line 214 of file baseMeasurement.py.
|
inherited |
Initialize the plugins (and slots) according to the configuration. Derived class constructors should call this method to fill the self.plugins attribute and add correspond output fields and slot aliases to the output schema. In addition to the attributes added by BaseMeasurementTask.__init__, a self.schema attribute holding the output schema must also be present before this method is called, . Keyword arguments are forwarded directly to plugin constructors, allowing derived classes to use plugins with different signatures.
Definition at line 217 of file baseMeasurement.py.
def lsst.meas.base.forcedMeasurement.ForcedMeasurementTask.run | ( | self, | |
measCat, | |||
exposure, | |||
refCat, | |||
refWcs, | |||
exposureId = None , |
|||
beginOrder = None , |
|||
endOrder = None |
|||
) |
Perform forced measurement.
[in] | exposure | lsst.afw.image.ExposureF to be measured; must have at least a Wcs attached. |
[in] | measCat | Source catalog for measurement results; must be initialized with empty records already corresponding to those in refCat (via e.g. generateMeasCat). |
[in] | refCat | A sequence of SourceRecord objects that provide reference information for the measurement. These will be passed to each Plugin in addition to the output SourceRecord. |
[in] | refWcs | Wcs that defines the X,Y coordinate system of refCat |
[in] | exposureId | optional unique exposureId used to calculate random number generator seed in the NoiseReplacer. |
[in] | beginOrder | beginning execution order (inclusive): measurements with executionOrder < beginOrder are not executed. None for no limit. |
[in] | endOrder | ending execution order (exclusive): measurements with executionOrder >= endOrder are not executed. None for no limit. |
Fills the initial empty SourceCatalog with forced measurement results. Two steps must occur before run() can be called:
Definition at line 253 of file forcedMeasurement.py.
|
inherited |
Definition at line 212 of file baseMeasurement.py.
|
static |
Definition at line 221 of file forcedMeasurement.py.
lsst.meas.base.forcedMeasurement.ForcedMeasurementTask.mapper |
Definition at line 242 of file forcedMeasurement.py.
|
inherited |
Definition at line 208 of file baseMeasurement.py.
lsst.meas.base.forcedMeasurement.ForcedMeasurementTask.schema |
Definition at line 250 of file forcedMeasurement.py.
|
inherited |
Definition at line 209 of file baseMeasurement.py.