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 existing ip_diffim_DipoleMeasurement classes until such a time as those are deemed to be replaceable by this.

Attributes Summary

APCORR_ORDER
CENTROID_ORDER
DEFAULT_CATALOGCALCULATION
FAILURE_EDGE
FAILURE_FIT
FAILURE_NOT_DIPOLE
FLUX_ORDER
SHAPE_ORDER
registry

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 since posFlux == negFlux.
fail(measRecord[, error]) !Catch failures and set the correct flags.
getExecutionOrder() !Set execution order to FLUX_ORDER.
getLogName()
getTransformClass() !
measure(measRecord, exposure[, posExp, negExp]) !Perform the non-linear least squares minimization on the putative dipole source.
measureN(measCat, exposure) !

Attributes Documentation

APCORR_ORDER = 3.0
CENTROID_ORDER = 0.0
DEFAULT_CATALOGCALCULATION = 4.0
FAILURE_EDGE = 1
FAILURE_FIT = 2
FAILURE_NOT_DIPOLE = 4
FLUX_ORDER = 2.0
SHAPE_ORDER = 1.0
registry = <lsst.meas.base.pluginRegistry.PluginRegistry object>

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 since posFlux == negFlux.
  • is it a good fit (chi2dof < 1)? (Currently not used.)
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() and getCentroid(), in addition to a Footprint and its Peaks.

getLogName()
static getTransformClass()

! Get the measurement transformation appropriate to this plugin.

This returns a subclass of 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.

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

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 is None, will compute posImage = exposure + negExp. Likewise, when negExp is None, will compute negImage = posExp - exposure. If both posExp and negExp are None, will attempt to fit the dipole to just the exposure with no constraint.

The main functionality of this routine was placed outside of this plugin (into DipoleFitAlgorithm.fitDipole()) so that DipoleFitAlgorithm.fitDipole() can be called separately for testing (@see tests/testDipoleFitter.py)

measureN(measCat, exposure)

! Measure the properties of a group of blended sources on a single image (single-epoch image or coadd).

@param[in,out] measCat lsst.afw.table.SourceCatalog to be filled with outputs,
and from which previously-measured quantities can be retrieved, containing only the sources that should be measured together in this call.
@param[in] exposure lsst.afw.image.ExposureF, containing the pixel data to
be measured and the associated Psf, Wcs, etc. Sources not in the blended hierarchy to be measured will have been replaced with noise using deblender outputs.

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.