LSST Applications 28.0.2,g0fba68d861+5b923b673a,g1fd858c14a+7a7b9dd5ed,g2c84ff76c0+5548bfee71,g30358e5240+f0e04ebe90,g35bb328faa+fcb1d3bbc8,g436fd98eb5+bdc6fcdd04,g4af146b050+742274f7cd,g4d2262a081+3efd3f8190,g4e0f332c67+cb09b8a5b6,g53246c7159+fcb1d3bbc8,g5a012ec0e7+477f9c599b,g5edb6fd927+826dfcb47f,g60b5630c4e+bdc6fcdd04,g67b6fd64d1+2218407a0c,g78460c75b0+2f9a1b4bcd,g786e29fd12+cf7ec2a62a,g7b71ed6315+fcb1d3bbc8,g87b7deb4dc+f9ac2ab1bd,g8852436030+ebf28f0d95,g89139ef638+2218407a0c,g9125e01d80+fcb1d3bbc8,g989de1cb63+2218407a0c,g9f33ca652e+42fb53f4c8,g9f7030ddb1+11b9b6f027,ga2b97cdc51+bdc6fcdd04,gab72ac2889+bdc6fcdd04,gabe3b4be73+1e0a283bba,gabf8522325+3210f02652,gb1101e3267+9c79701da9,gb58c049af0+f03b321e39,gb89ab40317+2218407a0c,gcf25f946ba+ebf28f0d95,gd6cbbdb0b4+e8f9c9c900,gd9a9a58781+fcb1d3bbc8,gde0f65d7ad+a08f294619,ge278dab8ac+3ef3db156b,ge410e46f29+2218407a0c,gf67bdafdda+2218407a0c
LSST Data Management Base Package
|
Public Member Functions | |
__init__ (self, config, exposure, footprints, noiseImage=None, exposureId=None, log=None) | |
insertSource (self, id) | |
removeSource (self, id) | |
end (self) | |
getNoiseGenerator (self, exposure, noiseImage, noiseMeanVar, exposureId=None) | |
Public Attributes | |
noiseSource = config.noiseSource | |
noiseOffset = config.noiseOffset | |
noiseSeedMultiplier = config.noiseSeedMultiplier | |
noiseGenMean = None | |
noiseGenStd = None | |
list | removeplanes = [] |
thisbitmask = mask.getPlaneBitMask(maskname) | |
otherbitmask = bitmasks | |
dict | heavies = {} |
dict | heavyNoise = {} |
Static Public Attributes | |
ConfigClass = NoiseReplacerConfig | |
exposure = None | |
footprints = None | |
log = None | |
Replace sources with noise during measurement. Parameters ---------- config : `NoiseReplacerConfig` Configuration. exposure : `lsst.afw.image.Exposure` Image in which sources will be replaced by noise. During operation, the image will be modified in-place to replace all sources. At the end of the measurment procedure, the original sources will be replaced. footprints : `dict` Mapping of ``id`` to a tuple of ``(parent, Footprint)``. When used in single-frame measurement, ``id`` is the source ID, but in forced photometry this is the reference ID (as that is used to determine deblend families). noiseImage : `lsst.afw.image.ImageF` An image used as a predictable noise replacement source. Used during testing only. log : `lsst.log.log.log.Log` or `logging.Logger`, optional Logger to use for status messages; no status messages will be recorded if `None`. Notes ----- When measuring a source (or the children associated with a parent source), this class is used to replace its neighbors with noise, using the deblender's definition of the sources as stored in `~lsst.afw.detection.heavyFootprint.HeavyFootprint`\ s attached to the `~lsst.afw.table.SourceRecord`\ s. The algorithm works as follows: #. All pixels in the source `~lsst.afw.detection.Footprint`\ s are replaced with artificially generated noise (in `NoiseReplacer.__init__`). #. Before each source is measured, we restore the original pixel data by inserting that source's `~lsst.afw.detection.heavyFootprint.HeavyFootprint` (from the deblender) into the image. #. After measurement, we again replace the source pixels with (the same) artificial noise. #. After measuring all sources, the image is returned to its original state. This is a functional copy of the code in the older ``ReplaceWithNoiseTask``, but with a slightly different API needed for the new measurement framework; note that it is not an `~lsst.pipe.base.Task`, as the lifetime of a ``NoiseReplacer`` now corresponds to a single exposure, not an entire processing run. When processing the ``footprints`` parameter, this routine should create `~lsst.afw.detection.heavyFootprint.HeavyFootprint`\ s for any non-Heavy `~lsst.afw.detection.Footprint`\ s, and replace them in the dictionary. It should then create a dict of `~lsst.afw.detection.heavyFootprint.HeavyFootprint`\ s containing noise, but only for parent objects, then replace all sources with noise. This should ignore any footprints that lay outside the bounding box of the exposure, and clip those that lie on the border. As the code currently stands, the heavy footprint for a deblended object must be available from the input catalog. If it is not, it cannot be reproduced here. In that case, the topmost parent in the objects parent chain must be used. The heavy footprint for that source is created in this class from the masked image.
Definition at line 58 of file noiseReplacer.py.
lsst.meas.base.noiseReplacer.NoiseReplacer.__init__ | ( | self, | |
config, | |||
exposure, | |||
footprints, | |||
noiseImage = None, | |||
exposureId = None, | |||
log = None ) |
Definition at line 136 of file noiseReplacer.py.
lsst.meas.base.noiseReplacer.NoiseReplacer.end | ( | self | ) |
End the NoiseReplacer. Restores original data to the exposure from the heavies dictionary and the mask planes to their original state.
Definition at line 272 of file noiseReplacer.py.
lsst.meas.base.noiseReplacer.NoiseReplacer.getNoiseGenerator | ( | self, | |
exposure, | |||
noiseImage, | |||
noiseMeanVar, | |||
exposureId = None ) |
Return a generator of artificial noise. Returns ------- noiseGenerator : `lsst.afw.image.noiseReplacer.NoiseGenerator`
Definition at line 296 of file noiseReplacer.py.
lsst.meas.base.noiseReplacer.NoiseReplacer.insertSource | ( | self, | |
id ) |
Insert the heavy footprint of a given source into the exposure. Parameters ---------- id : `int` ID of the source to insert from original dictionary of footprints. Notes ----- Also adjusts the mask plane to show the source of this footprint.
Definition at line 212 of file noiseReplacer.py.
lsst.meas.base.noiseReplacer.NoiseReplacer.removeSource | ( | self, | |
id ) |
Replace the heavy footprint of a given source with noise. The same artificial noise is used as in the original replacement. Parameters ---------- id : `int` ID of the source to replace from original dictionary of footprints. Notes ----- Also restores the mask plane.
Definition at line 239 of file noiseReplacer.py.
|
static |
Definition at line 122 of file noiseReplacer.py.
|
static |
Definition at line 124 of file noiseReplacer.py.
|
static |
Definition at line 128 of file noiseReplacer.py.
dict lsst.meas.base.noiseReplacer.NoiseReplacer.heavies = {} |
Definition at line 173 of file noiseReplacer.py.
dict lsst.meas.base.noiseReplacer.NoiseReplacer.heavyNoise = {} |
Definition at line 197 of file noiseReplacer.py.
|
static |
Definition at line 132 of file noiseReplacer.py.
lsst.meas.base.noiseReplacer.NoiseReplacer.noiseGenMean = None |
Definition at line 141 of file noiseReplacer.py.
lsst.meas.base.noiseReplacer.NoiseReplacer.noiseGenStd = None |
Definition at line 142 of file noiseReplacer.py.
lsst.meas.base.noiseReplacer.NoiseReplacer.noiseOffset = config.noiseOffset |
Definition at line 139 of file noiseReplacer.py.
lsst.meas.base.noiseReplacer.NoiseReplacer.noiseSeedMultiplier = config.noiseSeedMultiplier |
Definition at line 140 of file noiseReplacer.py.
lsst.meas.base.noiseReplacer.NoiseReplacer.noiseSource = config.noiseSource |
Definition at line 138 of file noiseReplacer.py.
lsst.meas.base.noiseReplacer.NoiseReplacer.otherbitmask = bitmasks |
Definition at line 171 of file noiseReplacer.py.
list lsst.meas.base.noiseReplacer.NoiseReplacer.removeplanes = [] |
Definition at line 153 of file noiseReplacer.py.
lsst.meas.base.noiseReplacer.NoiseReplacer.thisbitmask = mask.getPlaneBitMask(maskname) |
Definition at line 171 of file noiseReplacer.py.