|
def | __init__ (self, modelImages, filterInfo=None, psf=None) |
|
def | fromImage (cls, maskedImage, dcrNumSubfilters, filterInfo=None, psf=None) |
|
def | fromDataRef (cls, dataRef, datasetType="dcrCoadd", numSubfilters=None, kwargs) |
|
def | __len__ (self) |
|
def | __getitem__ (self, subfilter) |
|
def | __setitem__ (self, subfilter, maskedImage) |
|
def | filter (self) |
|
def | psf (self) |
|
def | bbox (self) |
|
def | getReferenceImage (self, bbox=None) |
|
def | assign (self, dcrSubModel, bbox=None) |
|
def | buildMatchedTemplate (self, exposure=None, warpCtrl=None, visitInfo=None, bbox=None, wcs=None, mask=None) |
|
def | buildMatchedExposure (self, exposure=None, warpCtrl=None, visitInfo=None, bbox=None, wcs=None, mask=None) |
|
def | conditionDcrModel (self, subfilter, newModel, bbox, gain=1.) |
|
def | clampModel (self, subfilter, newModel, bbox, statsCtrl, regularizeSigma, modelClampFactor, convergenceMaskPlanes="DETECTED") |
|
def | regularizeModel (self, bbox, mask, statsCtrl, regularizeSigma, clampFrequency, convergenceMaskPlanes="DETECTED") |
|
def | calculateNoiseCutoff (self, maskedImage, statsCtrl, regularizeSigma, convergenceMaskPlanes="DETECTED", mask=None) |
|
A model of the true sky after correcting chromatic effects.
Attributes
----------
dcrNumSubfilters : `int`
Number of sub-filters used to model chromatic effects within a band.
filterInfo : `lsst.afw.image.Filter`
The filter definition, set in the current instruments' obs package.
modelImages : `list` of `lsst.afw.image.MaskedImage`
A list of masked images, each containing the model for one subfilter
Parameters
----------
modelImages : `list` of `lsst.afw.image.MaskedImage`
A list of masked images, each containing the model for one subfilter.
filterInfo : `lsst.afw.image.Filter`, optional
The filter definition, set in the current instruments' obs package.
Required for any calculation of DCR, including making matched templates.
Notes
-----
The ``DcrModel`` contains an estimate of the true sky, at a higher
wavelength resolution than the input observations. It can be forward-
modeled to produce Differential Chromatic Refraction (DCR) matched
templates for a given ``Exposure``, and provides utilities for conditioning
the model in ``dcrAssembleCoadd`` to avoid oscillating solutions between
iterations of forward modeling or between the subfilters of the model.
Definition at line 35 of file dcrModel.py.
def lsst.ip.diffim.dcrModel.DcrModel.buildMatchedExposure |
( |
|
self, |
|
|
|
exposure = None , |
|
|
|
warpCtrl = None , |
|
|
|
visitInfo = None , |
|
|
|
bbox = None , |
|
|
|
wcs = None , |
|
|
|
mask = None |
|
) |
| |
Wrapper to create an exposure from a template image.
Parameters
----------
exposure : `lsst.afw.image.Exposure`, optional
The input exposure to build a matched template for.
May be omitted if all of the metadata is supplied separately
warpCtrl : `lsst.afw.Math.WarpingControl`
Configuration settings for warping an image
visitInfo : `lsst.afw.image.VisitInfo`, optional
Metadata for the exposure. Ignored if ``exposure`` is set.
bbox : `lsst.afw.geom.Box2I`, optional
Sub-region of the coadd. Ignored if ``exposure`` is set.
wcs : `lsst.afw.geom.SkyWcs`, optional
Coordinate system definition (wcs) for the exposure.
Ignored if ``exposure`` is set.
mask : `lsst.afw.image.Mask`, optional
reference mask to use for the template image.
Returns
-------
templateExposure : `lsst.afw.image.exposureF`
The DCR-matched template
Definition at line 335 of file dcrModel.py.
def lsst.ip.diffim.dcrModel.DcrModel.buildMatchedTemplate |
( |
|
self, |
|
|
|
exposure = None , |
|
|
|
warpCtrl = None , |
|
|
|
visitInfo = None , |
|
|
|
bbox = None , |
|
|
|
wcs = None , |
|
|
|
mask = None |
|
) |
| |
Create a DCR-matched template image for an exposure.
Parameters
----------
exposure : `lsst.afw.image.Exposure`, optional
The input exposure to build a matched template for.
May be omitted if all of the metadata is supplied separately
warpCtrl : `lsst.afw.Math.WarpingControl`, optional
Configuration settings for warping an image.
If not set, defaults to a lanczos3 warping kernel for the image,
and a bilinear kernel for the mask
visitInfo : `lsst.afw.image.VisitInfo`, optional
Metadata for the exposure. Ignored if ``exposure`` is set.
bbox : `lsst.afw.geom.Box2I`, optional
Sub-region of the coadd. Ignored if ``exposure`` is set.
wcs : `lsst.afw.geom.SkyWcs`, optional
Coordinate system definition (wcs) for the exposure.
Ignored if ``exposure`` is set.
mask : `lsst.afw.image.Mask`, optional
reference mask to use for the template image.
Returns
-------
templateImage : `lsst.afw.image.maskedImageF`
The DCR-matched template
Raises
------
ValueError
If neither ``exposure`` or all of ``visitInfo``, ``bbox``, and ``wcs`` are set.
Definition at line 280 of file dcrModel.py.
def lsst.ip.diffim.dcrModel.DcrModel.fromDataRef |
( |
|
cls, |
|
|
|
dataRef, |
|
|
|
datasetType = "dcrCoadd" , |
|
|
|
numSubfilters = None , |
|
|
|
kwargs |
|
) |
| |
Load an existing DcrModel from a repository.
Parameters
----------
dataRef : `lsst.daf.persistence.ButlerDataRef`
Data reference defining the patch for coaddition and the
reference Warp
datasetType : `str`, optional
Name of the DcrModel in the registry {"dcrCoadd", "dcrCoadd_sub"}
numSubfilters : `int`
Number of sub-filters used to model chromatic effects within a band.
**kwargs
Additional keyword arguments to pass to look up the model in the data registry.
Common keywords and their types include: ``tract``:`str`, ``patch``:`str`,
``bbox``:`lsst.afw.geom.Box2I`
Returns
-------
dcrModel : `lsst.pipe.tasks.DcrModel`
Best fit model of the true sky after correcting chromatic effects.
Definition at line 113 of file dcrModel.py.
def lsst.ip.diffim.dcrModel.DcrModel.fromImage |
( |
|
cls, |
|
|
|
maskedImage, |
|
|
|
dcrNumSubfilters, |
|
|
|
filterInfo = None , |
|
|
|
psf = None |
|
) |
| |
Initialize a DcrModel by dividing a coadd between the subfilters.
Parameters
----------
maskedImage : `lsst.afw.image.MaskedImage`
Input coadded image to divide equally between the subfilters.
dcrNumSubfilters : `int`
Number of sub-filters used to model chromatic effects within a band.
filterInfo : `lsst.afw.image.Filter`, optional
The filter definition, set in the current instruments' obs package.
Required for any calculation of DCR, including making matched templates.
psf : `lsst.afw.detection.Psf`, optional
Point spread function (PSF) of the model.
Required if the ``DcrModel`` will be persisted.
Returns
-------
dcrModel : `lsst.pipe.tasks.DcrModel`
Best fit model of the true sky after correcting chromatic effects.
Definition at line 72 of file dcrModel.py.
def lsst.ip.diffim.dcrModel.DcrModel.regularizeModel |
( |
|
self, |
|
|
|
bbox, |
|
|
|
mask, |
|
|
|
statsCtrl, |
|
|
|
regularizeSigma, |
|
|
|
clampFrequency, |
|
|
|
convergenceMaskPlanes = "DETECTED" |
|
) |
| |
Restrict large variations in the model between subfilters.
Any flux subtracted by the restriction is accumulated from all
subfilters, and divided evenly to each afterwards in order to preserve
total flux.
Parameters
----------
bbox : `lsst.afw.geom.Box2I`
Sub-region to coadd
mask : `lsst.afw.image.Mask`
Reference mask to use for all model planes.
statsCtrl : `lsst.afw.math.StatisticsControl`
Statistics control object for coadd
regularizeSigma : `float`
Threshold to exclude noise-like pixels from regularization.
clampFrequency : `float`
Maximum relative change of the model allowed between subfilters.
convergenceMaskPlanes : `list` of `str`, or `str`, optional
Mask planes to use to calculate convergence. (Default is "DETECTED")
Default value is set in ``calculateNoiseCutoff`` if not supplied.
Definition at line 436 of file dcrModel.py.