DipoleFitPlugin¶
-
class
lsst.ip.diffim.
DipoleFitPlugin
(config, name, schema, metadata)¶ Bases:
lsst.meas.base.sfm.SingleFramePlugin
!Subclass of SingleFramePlugin which fits dipoles to all merged (two-peak) diaSources
Accepts up to three input images in its
measure
method. If these are provided, it includes data from the pre-subtraction posImage (science image) and optionally negImage (template image) to constrain the fit. The meat of the fitting routines are in the class DipoleFitAlgorithm.The motivation behind this plugin and the necessity for including more than one exposure are documented in DMTN-007 (http://dmtn-007.lsst.io).
This class is named
ip_diffim_DipoleFit
so that it may be used alongside the existingip_diffim_DipoleMeasurement
classes until such a time as those are deemed to be replaceable by this.Attributes Summary
FAILURE_EDGE
FAILURE_FIT
FAILURE_NOT_DIPOLE
Methods Summary
doClassify
(measRecord, chi2val)!Determine if source is classified as dipole via three criteria: - does the total signal-to-noise surpass the minSn? - are the pos/neg fluxes greater than 1.0 and no more than 0.65 (param maxFluxRatio
) of the total flux? By default this will never happen sinceposFlux == negFlux
.fail
(measRecord[, error])!Catch failures and set the correct flags. getExecutionOrder
()!Set execution order to FLUX_ORDER
.measure
(measRecord, exposure[, posExp, negExp])!Perform the non-linear least squares minimization on the putative dipole source. Attributes Documentation
-
FAILURE_EDGE
= 1¶
-
FAILURE_FIT
= 2¶
-
FAILURE_NOT_DIPOLE
= 4¶
Methods Documentation
-
doClassify
(measRecord, chi2val)¶ !Determine if source is classified as dipole via three criteria: - does the total signal-to-noise surpass the minSn? - are the pos/neg fluxes greater than 1.0 and no more than 0.65 (param
maxFluxRatio
)of the total flux? By default this will never happen sinceposFlux == negFlux
.- is it a good fit (
chi2dof
< 1)? (Currently not used.)
- is it a good fit (
-
fail
(measRecord, error=None)¶ !Catch failures and set the correct flags.
-
classmethod
getExecutionOrder
()¶ !Set execution order to
FLUX_ORDER
.This includes algorithms that require both
getShape()
andgetCentroid()
, in addition to a Footprint and its Peaks.
-
measure
(measRecord, exposure, posExp=None, negExp=None)¶ !Perform the non-linear least squares minimization on the putative dipole source.
@param measRecord diaSources that will be measured using dipole measurement @param exposure Difference exposure on which the diaSources were detected;
exposure = posExp-negExp
@param posExp “Positive” exposure, typically a science exposure, or None if unavailable @param negExp “Negative” exposure, typically a template exposure, or None if unavailable@note When
posExp
isNone
, will computeposImage = exposure + negExp
. Likewise, whennegExp
isNone
, will computenegImage = posExp - exposure
. If bothposExp
andnegExp
areNone
, will attempt to fit the dipole to just theexposure
with no constraint.The main functionality of this routine was placed outside of this plugin (into
DipoleFitAlgorithm.fitDipole()
) so thatDipoleFitAlgorithm.fitDipole()
can be called separately for testing (@seetests/testDipoleFitter.py
)
-