LSST Applications g0265f82a02+d6b5cd48b5,g02d81e74bb+a41d3748ce,g1470d8bcf6+6be6c9203b,g2079a07aa2+14824f138e,g212a7c68fe+a4f2ea4efa,g2305ad1205+72971fe858,g295015adf3+ab2c85acae,g2bbee38e9b+d6b5cd48b5,g337abbeb29+d6b5cd48b5,g3ddfee87b4+31b3a28dff,g487adcacf7+082e807817,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+b2918d57ae,g5a732f18d5+66d966b544,g64a986408d+a41d3748ce,g858d7b2824+a41d3748ce,g8a8a8dda67+a6fc98d2e7,g99cad8db69+7fe4acdf18,g9ddcbc5298+d4bad12328,ga1e77700b3+246acaaf9c,ga8c6da7877+84af8b3ff8,gb0e22166c9+3863383f4c,gb6a65358fc+d6b5cd48b5,gba4ed39666+9664299f35,gbb8dafda3b+d8d527deb2,gc07e1c2157+b2dbe6b631,gc120e1dc64+61440b2abb,gc28159a63d+d6b5cd48b5,gcf0d15dbbd+31b3a28dff,gdaeeff99f8+a38ce5ea23,ge6526c86ff+39927bb362,ge79ae78c31+d6b5cd48b5,gee10cc3b42+a6fc98d2e7,gf1cff7945b+a41d3748ce,v24.1.5.rc1
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lsst.ip.diffim.dipoleMeasurement.ClassificationDipolePlugin Class Reference
Inheritance diagram for lsst.ip.diffim.dipoleMeasurement.ClassificationDipolePlugin:
lsst.meas.base.sfm.SingleFramePlugin lsst.meas.base.baseMeasurement.BaseMeasurementPlugin lsst.meas.base.pluginsBase.BasePlugin

Public Member Functions

 getExecutionOrder (cls)
 
 __init__ (self, config, name, schema, metadata)
 
 measure (self, measRecord, exposure)
 
 fail (self, measRecord, error=None)
 

Public Attributes

 dipoleAnalysis
 
 keyProbability
 
 keyFlag
 

Static Public Attributes

 ConfigClass = ClassificationDipoleConfig
 

Detailed Description

A plugin to classify whether a diaSource is a dipole.

Definition at line 51 of file dipoleMeasurement.py.

Constructor & Destructor Documentation

◆ __init__()

lsst.ip.diffim.dipoleMeasurement.ClassificationDipolePlugin.__init__ ( self,
config,
name,
schema,
metadata )

Reimplemented from lsst.meas.base.sfm.SingleFramePlugin.

Definition at line 66 of file dipoleMeasurement.py.

66 def __init__(self, config, name, schema, metadata):
67 SingleFramePlugin.__init__(self, config, name, schema, metadata)
68 self.dipoleAnalysis = DipoleAnalysis()
69 self.keyProbability = schema.addField(name + "_value", type="D",
70 doc="Set to 1 for dipoles, else 0.")
71 self.keyFlag = schema.addField(name + "_flag", type="Flag", doc="Set to 1 for any fatal failure.")
72

Member Function Documentation

◆ fail()

lsst.ip.diffim.dipoleMeasurement.ClassificationDipolePlugin.fail ( self,
measRecord,
error = None )
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 from lsst.meas.base.pluginsBase.BasePlugin.

Definition at line 96 of file dipoleMeasurement.py.

96 def fail(self, measRecord, error=None):
97 measRecord.set(self.keyFlag, True)
98
99

◆ getExecutionOrder()

lsst.ip.diffim.dipoleMeasurement.ClassificationDipolePlugin.getExecutionOrder ( cls)
Returns
-------
result : `callable`

Reimplemented from lsst.meas.base.pluginsBase.BasePlugin.

Definition at line 58 of file dipoleMeasurement.py.

58 def getExecutionOrder(cls):
59 """
60 Returns
61 -------
62 result : `callable`
63 """
64 return cls.APCORR_ORDER
65

◆ measure()

lsst.ip.diffim.dipoleMeasurement.ClassificationDipolePlugin.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 from lsst.meas.base.sfm.SingleFramePlugin.

Definition at line 73 of file dipoleMeasurement.py.

73 def measure(self, measRecord, exposure):
74 passesSn = self.dipoleAnalysis.getSn(measRecord) > self.config.minSn
75 negFlux = np.abs(measRecord.get("ip_diffim_PsfDipoleFlux_neg_instFlux"))
76 negFluxFlag = measRecord.get("ip_diffim_PsfDipoleFlux_neg_flag")
77 posFlux = np.abs(measRecord.get("ip_diffim_PsfDipoleFlux_pos_instFlux"))
78 posFluxFlag = measRecord.get("ip_diffim_PsfDipoleFlux_pos_flag")
79
80 if negFluxFlag or posFluxFlag:
81 self.fail(measRecord)
82 # continue on to classify
83
84 totalFlux = negFlux + posFlux
85
86 # If negFlux or posFlux are NaN, these evaluate to False
87 passesFluxNeg = (negFlux / totalFlux) < self.config.maxFluxRatio
88 passesFluxPos = (posFlux / totalFlux) < self.config.maxFluxRatio
89 if (passesSn and passesFluxPos and passesFluxNeg):
90 val = 1.0
91 else:
92 val = 0.0
93
94 measRecord.set(self.keyProbability, val)
95

Member Data Documentation

◆ ConfigClass

lsst.ip.diffim.dipoleMeasurement.ClassificationDipolePlugin.ConfigClass = ClassificationDipoleConfig
static

Definition at line 55 of file dipoleMeasurement.py.

◆ dipoleAnalysis

lsst.ip.diffim.dipoleMeasurement.ClassificationDipolePlugin.dipoleAnalysis

Definition at line 68 of file dipoleMeasurement.py.

◆ keyFlag

lsst.ip.diffim.dipoleMeasurement.ClassificationDipolePlugin.keyFlag

Definition at line 71 of file dipoleMeasurement.py.

◆ keyProbability

lsst.ip.diffim.dipoleMeasurement.ClassificationDipolePlugin.keyProbability

Definition at line 69 of file dipoleMeasurement.py.


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