DipoleFitPlugin#
- class lsst.ip.diffim.DipoleFitPlugin(config, name, schema, metadata, logName=None)#
Bases:
SingleFramePluginA single frame measurement plugin that fits dipoles to all merged (two-peak)
diaSources.This measurement plugin accepts up to three input images in its
measuremethod. 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 classDipoleFitAlgorithm.Notes#
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_DipoleFitso that it may be used alongside the existingip_diffim_DipoleMeasurementclasses until such a time as those are deemed to be replaceable by this.Attributes Summary
Methods Summary
doClassify(measRecord, chi2val)Classify a source as a dipole.
fail(measRecord[, error])Catch failures and set the correct flags.
This algorithm simultaneously fits the centroid and flux, and does not require any previous centroid fit.
measureDipoles(measRecord, exposure[, ...])Perform the non-linear least squares minimization on the putative dipole source.
Attributes Documentation
- FAILURE_EDGE = 1#
- FAILURE_FIT = 2#
- FAILURE_NOT_DIPOLE = 4#
- FAILURE_TOO_LARGE = 8#
Methods Documentation
- doClassify(measRecord, chi2val)#
Classify a source as a dipole.
Parameters#
- measRecordTODO: DM-17458
TODO: DM-17458
- chi2valTODO: DM-17458
TODO: DM-17458
Notes#
Sources are classified as dipoles, or not, according to 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 (
maxFluxRatio) of the total flux? By default this will never happen sinceposFlux == negFlux.Is it a good fit (
chi2dof< 1)? (Currently not used.)
- fail(measRecord, error=None)#
Catch failures and set the correct flags.
Fallback on the current slot centroid positions, but set the dipole failure flag, since we attempted to fit the source.
- classmethod getExecutionOrder()#
This algorithm simultaneously fits the centroid and flux, and does not require any previous centroid fit.
- measureDipoles(measRecord, exposure, posExp=None, negExp=None)#
Perform the non-linear least squares minimization on the putative dipole source.
Parameters#
- measRecord
lsst.afw.table.SourceRecord diaSources that will be measured using dipole measurement
- exposure
lsst.afw.image.Exposure Difference exposure on which the diaSources were detected;
exposure = posExp-negExpIf bothposExpandnegExpareNone, will attempt to fit the dipole to just theexposurewith no constraint.- posExp
lsst.afw.image.Exposure, optional “Positive” exposure, typically a science exposure, or None if unavailable When
posExpisNone, will computeposImage = exposure + negExp.- negExp
lsst.afw.image.Exposure, optional “Negative” exposure, typically a template exposure, or None if unavailable When
negExpisNone, will computenegImage = posExp - exposure.
Notes#
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)- measRecord