LSST Applications g0fba68d861+bb7a7cfa1f,g1ec0fe41b4+f536777771,g1fd858c14a+470a99fdf4,g216c3ac8a7+0d4d80193f,g35bb328faa+fcb1d3bbc8,g4d2262a081+23bd310d1b,g53246c7159+fcb1d3bbc8,g56a49b3a55+369644a549,g5a012ec0e7+3632fc3ff3,g60b5630c4e+3bfb9058a5,g67b6fd64d1+ed4b5058f4,g78460c75b0+2f9a1b4bcd,g786e29fd12+cf7ec2a62a,g8180f54f50+60bd39f3b6,g8352419a5c+fcb1d3bbc8,g87d29937c9+57a68d035f,g8852436030+4699110379,g89139ef638+ed4b5058f4,g9125e01d80+fcb1d3bbc8,g94187f82dc+3bfb9058a5,g989de1cb63+ed4b5058f4,g9ccd5d7f00+b7cae620c0,g9d31334357+3bfb9058a5,g9f33ca652e+00883ace41,gabe3b4be73+1e0a283bba,gabf8522325+fa80ff7197,gb1101e3267+27b24065a3,gb58c049af0+f03b321e39,gb89ab40317+ed4b5058f4,gc0af124501+708fe67c54,gcf25f946ba+4699110379,gd6cbbdb0b4+bb83cc51f8,gde0f65d7ad+acd5afb0eb,ge1ad929117+3bfb9058a5,ge278dab8ac+d65b3c2b70,ge410e46f29+ed4b5058f4,gf5e32f922b+fcb1d3bbc8,gf67bdafdda+ed4b5058f4,w.2025.17
LSST Data Management Base Package
Loading...
Searching...
No Matches
lsst.meas.base.sfm.SingleFramePlugin Class Reference
Inheritance diagram for lsst.meas.base.sfm.SingleFramePlugin:
lsst.meas.base.baseMeasurement.BaseMeasurementPlugin lsst.meas.base.pluginsBase.BasePlugin lsst.ip.diffim.dipoleMeasurement.ClassificationDipolePlugin lsst.meas.base.compensatedGaussian._compensatedGaussian.SingleFrameCompensatedGaussianFluxPlugin lsst.meas.base.compensatedGaussian._compensatedTophat.SingleFrameCompensatedTophatFluxPlugin lsst.meas.base.plugins.SingleFrameClassificationSizeExtendednessPlugin lsst.meas.base.plugins.SingleFrameFPPositionPlugin lsst.meas.base.plugins.SingleFrameJacobianPlugin lsst.meas.base.plugins.SingleFramePeakCentroidPlugin lsst.meas.base.plugins.SingleFrameSkyCoordPlugin lsst.meas.base.wrappers.WrappedSingleFramePlugin lsst.meas.extensions.trailedSources.NaivePlugin.SingleFrameNaiveTrailPlugin lsst.meas.extensions.trailedSources.VeresPlugin.SingleFrameVeresTrailPlugin lsst.meas.modelfit.cmodel.cmodelContinued.CModelSingleFramePlugin lsst.meas.modelfit.psf.psfContinued.GeneralShapeletPsfApproxSingleFramePlugin

Public Member Functions

 __init__ (self, config, name, schema, metadata, logName=None, **kwds)
 
 measure (self, measRecord, exposure)
 
 measureN (self, measCat, exposure)
 
 getExecutionOrder (cls)
 
 getLogName (self)
 
 fail (self, measRecord, error=None)
 

Static Public Member Functions

 getTransformClass ()
 

Public Attributes

 config = config
 
 name = name
 
 logName = logName
 

Static Public Attributes

 registry = PluginRegistry(SingleFramePluginConfig)
 
float CENTROID_ORDER = 0.0
 
float SHAPE_ORDER = 1.0
 
float FLUX_ORDER = 2.0
 
float APCORR_ORDER = 3.0
 
float DEFAULT_CATALOGCALCULATION = 4.0
 
 ConfigClass = BasePluginConfig
 

Detailed Description

Base class for single-frame measurement plugin.

Parameters
----------
config : `SingleFramePlugin.ConfigClass`
    Configuration for this plugin.
name : `str`
    The string with which the plugin was registered.
schema : `lsst.afw.table.Schema`
    The schema for the source table . New fields are added here to
    hold measurements produced by this plugin.
metadata : `lsst.daf.base.PropertySet`
    Plugin metadata that will be attached to the output catalog
logName : `str`, optional
    Name to use when logging errors.

Notes
-----
New plugins can be created in Python by inheriting directly from this
class and implementing the `measure`, `fail` (from `BasePlugin`), and
optionally `__init__` and `measureN` methods.  Plugins can also be defined
in C++ via the `WrappedSingleFramePlugin` class.

Definition at line 52 of file sfm.py.

Constructor & Destructor Documentation

◆ __init__()

lsst.meas.base.sfm.SingleFramePlugin.__init__ ( self,
config,
name,
schema,
metadata,
logName = None,
** kwds )

Definition at line 83 of file sfm.py.

83 def __init__(self, config, name, schema, metadata, logName=None, **kwds):
84 BaseMeasurementPlugin.__init__(self, config, name, logName=logName)
85

Member Function Documentation

◆ fail()

lsst.meas.base.pluginsBase.BasePlugin.fail ( self,
measRecord,
error = None )
inherited
Record a failure of the `measure` or `measureN` method.

Parameters
----------
measRecord : `lsst.afw.table.SourceRecord`
    Table record describing the source being measured.
error : `MeasurementError`, optional
    Only provided if the measurement failed due to a
    `MeasurementError` being raised; otherwise, will be `None`.

Notes
-----
When the plugin raises an exception, framework will call
`BasePlugin.fail` to allow the plugin to set its failure flag
field(s).  When `BasePlugin.measureN` raises an exception,
`BasePlugin.fail` will be called repeatedly with all the records that
were being measured.

If the exception is an `MeasurementError`, it will be passed as the
error argument; in all other cases the error argument will be `None`,
and the failure will be logged by the measurement framework as a
warning.

Reimplemented in lsst.ip.diffim.dipoleMeasurement.ClassificationDipolePlugin, lsst.meas.base.classification.CatalogCalculationClassificationPlugin, lsst.meas.base.compensatedGaussian._compensatedGaussian.SingleFrameCompensatedGaussianFluxPlugin, lsst.meas.base.compensatedGaussian._compensatedTophat.SingleFrameCompensatedTophatFluxPlugin, lsst.meas.base.diaCalculation.DiaObjectCalculationPlugin, lsst.meas.base.footprintArea.CatalogCalculationFootprintAreaPlugin, lsst.meas.base.plugins.InputCountPlugin, lsst.meas.base.plugins.SingleFrameClassificationSizeExtendednessPlugin, lsst.meas.base.plugins.SingleFrameFPPositionPlugin, lsst.meas.base.plugins.SingleFrameJacobianPlugin, lsst.meas.base.plugins.SingleFramePeakCentroidPlugin, lsst.meas.base.plugins.SingleFrameSkyCoordPlugin, lsst.meas.base.plugins.VariancePlugin, lsst.meas.base.wrappers.GenericPlugin, lsst.meas.base.wrappers.WrappedForcedPlugin, lsst.meas.base.wrappers.WrappedSingleFramePlugin, lsst.meas.extensions.trailedSources.NaivePlugin.SingleFrameNaiveTrailPlugin, lsst.meas.extensions.trailedSources.VeresPlugin.SingleFrameVeresTrailPlugin, lsst.meas.modelfit.cmodel.cmodelContinued.CModelForcedPlugin, lsst.meas.modelfit.cmodel.cmodelContinued.CModelSingleFramePlugin, lsst.meas.modelfit.psf.psfContinued.GeneralShapeletPsfApproxForcedPlugin, and lsst.meas.modelfit.psf.psfContinued.GeneralShapeletPsfApproxSingleFramePlugin.

Definition at line 137 of file pluginsBase.py.

137 def fail(self, measRecord, error=None):
138 """Record a failure of the `measure` or `measureN` method.
139
140 Parameters
141 ----------
142 measRecord : `lsst.afw.table.SourceRecord`
143 Table record describing the source being measured.
144 error : `MeasurementError`, optional
145 Only provided if the measurement failed due to a
146 `MeasurementError` being raised; otherwise, will be `None`.
147
148 Notes
149 -----
150 When the plugin raises an exception, framework will call
151 `BasePlugin.fail` to allow the plugin to set its failure flag
152 field(s). When `BasePlugin.measureN` raises an exception,
153 `BasePlugin.fail` will be called repeatedly with all the records that
154 were being measured.
155
156 If the exception is an `MeasurementError`, it will be passed as the
157 error argument; in all other cases the error argument will be `None`,
158 and the failure will be logged by the measurement framework as a
159 warning.
160
161 """
162 traceback.print_exc()
163 message = ("The algorithm '%s' thinks it cannot fail, but it did; "
164 "please report this as a bug (the full traceback is above)."
165 % (self.__class__.__name__,))
166 raise NotImplementedError(message)
167

◆ getExecutionOrder()

lsst.meas.base.pluginsBase.BasePlugin.getExecutionOrder ( cls)
inherited
Get the relative execution order of this plugin.

Must be reimplemented as a class method by concrete derived classes.

Reimplemented in lsst.ip.diffim.dipoleMeasurement.ClassificationDipolePlugin, lsst.meas.base.catalogCalculation.CatalogCalculationPlugin, lsst.meas.base.classification.CatalogCalculationClassificationPlugin, lsst.meas.base.compensatedGaussian._compensatedGaussian.SingleFrameCompensatedGaussianFluxPlugin, lsst.meas.base.compensatedGaussian._compensatedTophat.SingleFrameCompensatedTophatFluxPlugin, lsst.meas.base.diaCalculationPlugins.Chi2DiaPsfFlux, lsst.meas.base.diaCalculationPlugins.ErrMeanDiaPsfFlux, lsst.meas.base.diaCalculationPlugins.HTMIndexDiaPosition, lsst.meas.base.diaCalculationPlugins.LinearFitDiaPsfFlux, lsst.meas.base.diaCalculationPlugins.LombScarglePeriodogram, lsst.meas.base.diaCalculationPlugins.LombScarglePeriodogramMulti, lsst.meas.base.diaCalculationPlugins.MadDiaPsfFlux, lsst.meas.base.diaCalculationPlugins.MaxSlopeDiaPsfFlux, lsst.meas.base.diaCalculationPlugins.MeanDiaPosition, lsst.meas.base.diaCalculationPlugins.MinMaxDiaPsfFlux, lsst.meas.base.diaCalculationPlugins.NumDiaSourcesDiaPlugin, lsst.meas.base.diaCalculationPlugins.PercentileDiaPsfFlux, lsst.meas.base.diaCalculationPlugins.SigmaDiaPsfFlux, lsst.meas.base.diaCalculationPlugins.SigmaDiaTotFlux, lsst.meas.base.diaCalculationPlugins.SimpleSourceFlagDiaPlugin, lsst.meas.base.diaCalculationPlugins.SkewDiaPsfFlux, lsst.meas.base.diaCalculationPlugins.StetsonJDiaPsfFlux, lsst.meas.base.diaCalculationPlugins.WeightedMeanDiaPsfFlux, lsst.meas.base.diaCalculationPlugins.WeightedMeanDiaTotFlux, lsst.meas.base.footprintArea.CatalogCalculationFootprintAreaPlugin, lsst.meas.base.plugins.EvaluateLocalPhotoCalibPlugin, lsst.meas.base.plugins.EvaluateLocalWcsPlugin, lsst.meas.base.plugins.ForcedPeakCentroidPlugin, lsst.meas.base.plugins.ForcedTransformedCentroidPlugin, lsst.meas.base.plugins.ForcedTransformedShapePlugin, lsst.meas.base.plugins.InputCountPlugin, lsst.meas.base.plugins.SingleFrameClassificationSizeExtendednessPlugin, lsst.meas.base.plugins.SingleFrameFPPositionPlugin, lsst.meas.base.plugins.SingleFrameJacobianPlugin, lsst.meas.base.plugins.SingleFramePeakCentroidPlugin, lsst.meas.base.plugins.SingleFrameSkyCoordPlugin, lsst.meas.base.plugins.VariancePlugin, lsst.meas.base.wrappers.GenericPlugin, lsst.meas.extensions.trailedSources.NaivePlugin.SingleFrameNaiveTrailPlugin, lsst.meas.extensions.trailedSources.VeresPlugin.SingleFrameVeresTrailPlugin, lsst.meas.modelfit.cmodel.cmodelContinued.CModelForcedPlugin, lsst.meas.modelfit.cmodel.cmodelContinued.CModelSingleFramePlugin, lsst.meas.modelfit.psf.psfContinued.GeneralShapeletPsfApproxForcedPlugin, and lsst.meas.modelfit.psf.psfContinued.GeneralShapeletPsfApproxSingleFramePlugin.

Definition at line 121 of file pluginsBase.py.

121 def getExecutionOrder(cls):
122 """Get the relative execution order of this plugin.
123
124 Must be reimplemented as a class method by concrete derived classes.
125 """
126 raise NotImplementedError("All plugins must implement getExecutionOrder()")
127

◆ getLogName()

lsst.meas.base.pluginsBase.BasePlugin.getLogName ( self)
inherited

Definition at line 134 of file pluginsBase.py.

134 def getLogName(self):
135 return self.logName
136

◆ getTransformClass()

lsst.meas.base.pluginsBase.BasePlugin.getTransformClass ( )
staticinherited
Get the measurement transformation appropriate to this plugin.

This returns a subclass of `transforms.MeasurementTransform`, which
may be instantiated with details of the algorithm configuration and
then called with information about calibration and WCS to convert from
raw measurement quantities to calibrated units. Calibrated data is
then provided in a separate output table.

Notes
-----
By default, we copy everything from the input to the output without
transformation.

Reimplemented in lsst.meas.base.plugins.ForcedPeakCentroidPlugin, and lsst.meas.base.plugins.SingleFramePeakCentroidPlugin.

Definition at line 169 of file pluginsBase.py.

169 def getTransformClass():
170 """Get the measurement transformation appropriate to this plugin.
171
172 This returns a subclass of `transforms.MeasurementTransform`, which
173 may be instantiated with details of the algorithm configuration and
174 then called with information about calibration and WCS to convert from
175 raw measurement quantities to calibrated units. Calibrated data is
176 then provided in a separate output table.
177
178 Notes
179 -----
180 By default, we copy everything from the input to the output without
181 transformation.
182 """
183 return PassThroughTransform

◆ measure()

lsst.meas.base.sfm.SingleFramePlugin.measure ( self,
measRecord,
exposure )
Measure the properties of a source on a single image.

The image may be from a single epoch, or it may be a coadd.

Parameters
----------
measRecord : `lsst.afw.table.SourceRecord`
    Record describing the object being measured. Previously-measured
    quantities may be retrieved from here, and it will be updated
    in-place tih the outputs of this plugin.
exposure : `lsst.afw.image.ExposureF`
    The pixel data to be measured, together with the associated PSF,
    WCS, etc. All other sources in the image should have been replaced
    by noise according to deblender outputs.

Reimplemented in lsst.ip.diffim.dipoleMeasurement.ClassificationDipolePlugin, lsst.meas.base.compensatedGaussian._compensatedGaussian.SingleFrameCompensatedGaussianFluxPlugin, lsst.meas.base.compensatedGaussian._compensatedTophat.SingleFrameCompensatedTophatFluxPlugin, lsst.meas.base.plugins.SingleFrameClassificationSizeExtendednessPlugin, lsst.meas.base.plugins.SingleFrameFPPositionPlugin, lsst.meas.base.plugins.SingleFrameJacobianPlugin, lsst.meas.base.plugins.SingleFramePeakCentroidPlugin, lsst.meas.base.plugins.SingleFrameSkyCoordPlugin, lsst.meas.base.wrappers.WrappedSingleFramePlugin, lsst.meas.extensions.trailedSources.NaivePlugin.SingleFrameNaiveTrailPlugin, lsst.meas.extensions.trailedSources.VeresPlugin.SingleFrameVeresTrailPlugin, lsst.meas.modelfit.cmodel.cmodelContinued.CModelSingleFramePlugin, and lsst.meas.modelfit.psf.psfContinued.GeneralShapeletPsfApproxSingleFramePlugin.

Definition at line 86 of file sfm.py.

86 def measure(self, measRecord, exposure):
87 """Measure the properties of a source on a single image.
88
89 The image may be from a single epoch, or it may be a coadd.
90
91 Parameters
92 ----------
93 measRecord : `lsst.afw.table.SourceRecord`
94 Record describing the object being measured. Previously-measured
95 quantities may be retrieved from here, and it will be updated
96 in-place tih the outputs of this plugin.
97 exposure : `lsst.afw.image.ExposureF`
98 The pixel data to be measured, together with the associated PSF,
99 WCS, etc. All other sources in the image should have been replaced
100 by noise according to deblender outputs.
101 """
102 raise NotImplementedError()
103

◆ measureN()

lsst.meas.base.sfm.SingleFramePlugin.measureN ( self,
measCat,
exposure )
Measure the properties of blended sources on a single image.

This operates on all members of a blend family at once. The image may
be from a single epoch, or it may be a coadd.

Parameters
----------
measCat : `lsst.afw.table.SourceCatalog`
    Catalog describing the objects (and only those objects) being
    measured. Previously-measured quantities will be retrieved from
    here, and it will be updated in-place with the outputs of this
    plugin.
exposure : `lsst.afw.image.ExposureF`
    The pixel data to be measured, together with the associated PSF,
    WCS, etc. All other sources in the image should have been replaced
    by noise according to deblender outputs.

Notes
-----
Derived classes that do not implement ``measureN`` should just inherit
this disabled version.  Derived classes that do implement ``measureN``
should additionally add a bool doMeasureN config field to their config
class to signal that measureN-mode is available.

Reimplemented in lsst.meas.base.wrappers.WrappedSingleFramePlugin.

Definition at line 104 of file sfm.py.

104 def measureN(self, measCat, exposure):
105 """Measure the properties of blended sources on a single image.
106
107 This operates on all members of a blend family at once. The image may
108 be from a single epoch, or it may be a coadd.
109
110 Parameters
111 ----------
112 measCat : `lsst.afw.table.SourceCatalog`
113 Catalog describing the objects (and only those objects) being
114 measured. Previously-measured quantities will be retrieved from
115 here, and it will be updated in-place with the outputs of this
116 plugin.
117 exposure : `lsst.afw.image.ExposureF`
118 The pixel data to be measured, together with the associated PSF,
119 WCS, etc. All other sources in the image should have been replaced
120 by noise according to deblender outputs.
121
122 Notes
123 -----
124 Derived classes that do not implement ``measureN`` should just inherit
125 this disabled version. Derived classes that do implement ``measureN``
126 should additionally add a bool doMeasureN config field to their config
127 class to signal that measureN-mode is available.
128 """
129 raise NotImplementedError()
130
131

Member Data Documentation

◆ APCORR_ORDER

float lsst.meas.base.pluginsBase.BasePlugin.APCORR_ORDER = 3.0
staticinherited

Definition at line 98 of file pluginsBase.py.

◆ CENTROID_ORDER

float lsst.meas.base.pluginsBase.BasePlugin.CENTROID_ORDER = 0.0
staticinherited

Definition at line 72 of file pluginsBase.py.

◆ config

lsst.meas.base.pluginsBase.BasePlugin.config = config
inherited

Definition at line 130 of file pluginsBase.py.

◆ ConfigClass

lsst.meas.base.pluginsBase.BasePlugin.ConfigClass = BasePluginConfig
staticinherited

Definition at line 116 of file pluginsBase.py.

◆ DEFAULT_CATALOGCALCULATION

float lsst.meas.base.pluginsBase.BasePlugin.DEFAULT_CATALOGCALCULATION = 4.0
staticinherited

Definition at line 108 of file pluginsBase.py.

◆ FLUX_ORDER

float lsst.meas.base.pluginsBase.BasePlugin.FLUX_ORDER = 2.0
staticinherited

Definition at line 89 of file pluginsBase.py.

◆ logName

lsst.meas.base.pluginsBase.BasePlugin.logName = logName
inherited

Definition at line 132 of file pluginsBase.py.

◆ name

lsst.meas.base.pluginsBase.BasePlugin.name = name
inherited

Definition at line 131 of file pluginsBase.py.

◆ registry

lsst.meas.base.sfm.SingleFramePlugin.registry = PluginRegistry(SingleFramePluginConfig)
static

Definition at line 77 of file sfm.py.

◆ SHAPE_ORDER

float lsst.meas.base.pluginsBase.BasePlugin.SHAPE_ORDER = 1.0
staticinherited

Definition at line 80 of file pluginsBase.py.


The documentation for this class was generated from the following file: