LSST Applications
21.0.0-147-g0e635eb1+1acddb5be5,22.0.0+052faf71bd,22.0.0+1ea9a8b2b2,22.0.0+6312710a6c,22.0.0+729191ecac,22.0.0+7589c3a021,22.0.0+9f079a9461,22.0.1-1-g7d6de66+b8044ec9de,22.0.1-1-g87000a6+536b1ee016,22.0.1-1-g8e32f31+6312710a6c,22.0.1-10-gd060f87+016f7cdc03,22.0.1-12-g9c3108e+df145f6f68,22.0.1-16-g314fa6d+c825727ab8,22.0.1-19-g93a5c75+d23f2fb6d8,22.0.1-19-gb93eaa13+aab3ef7709,22.0.1-2-g8ef0a89+b8044ec9de,22.0.1-2-g92698f7+9f079a9461,22.0.1-2-ga9b0f51+052faf71bd,22.0.1-2-gac51dbf+052faf71bd,22.0.1-2-gb66926d+6312710a6c,22.0.1-2-gcb770ba+09e3807989,22.0.1-20-g32debb5+b8044ec9de,22.0.1-23-gc2439a9a+fb0756638e,22.0.1-3-g496fd5d+09117f784f,22.0.1-3-g59f966b+1e6ba2c031,22.0.1-3-g849a1b8+f8b568069f,22.0.1-3-gaaec9c0+c5c846a8b1,22.0.1-32-g5ddfab5d3+60ce4897b0,22.0.1-4-g037fbe1+64e601228d,22.0.1-4-g8623105+b8044ec9de,22.0.1-5-g096abc9+d18c45d440,22.0.1-5-g15c806e+57f5c03693,22.0.1-7-gba73697+57f5c03693,master-g6e05de7fdc+c1283a92b8,master-g72cdda8301+729191ecac,w.2021.39
LSST Data Management Base Package
|
Public Member Functions | |
def | __init__ (self, config, exposure, footprints, noiseImage=None, exposureId=None, log=None) |
def | insertSource (self, id) |
def | removeSource (self, id) |
def | end (self) |
def | getNoiseGenerator (self, exposure, noiseImage, noiseMeanVar, exposureId=None) |
Public Attributes | |
noiseSource | |
noiseOffset | |
noiseSeedMultiplier | |
noiseGenMean | |
noiseGenStd | |
removeplanes | |
otherbitmask | |
heavies | |
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 57 of file noiseReplacer.py.
def lsst.meas.base.noiseReplacer.NoiseReplacer.__init__ | ( | self, | |
config, | |||
exposure, | |||
footprints, | |||
noiseImage = None , |
|||
exposureId = None , |
|||
log = None |
|||
) |
Definition at line 135 of file noiseReplacer.py.
def 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 274 of file noiseReplacer.py.
def 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 298 of file noiseReplacer.py.
def 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 214 of file noiseReplacer.py.
def 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 241 of file noiseReplacer.py.
|
static |
Definition at line 121 of file noiseReplacer.py.
|
static |
Definition at line 123 of file noiseReplacer.py.
|
static |
Definition at line 127 of file noiseReplacer.py.
lsst.meas.base.noiseReplacer.NoiseReplacer.heavies |
Definition at line 172 of file noiseReplacer.py.
lsst.meas.base.noiseReplacer.NoiseReplacer.heavyNoise |
Definition at line 196 of file noiseReplacer.py.
|
static |
Definition at line 131 of file noiseReplacer.py.
lsst.meas.base.noiseReplacer.NoiseReplacer.noiseGenMean |
Definition at line 140 of file noiseReplacer.py.
lsst.meas.base.noiseReplacer.NoiseReplacer.noiseGenStd |
Definition at line 141 of file noiseReplacer.py.
lsst.meas.base.noiseReplacer.NoiseReplacer.noiseOffset |
Definition at line 138 of file noiseReplacer.py.
lsst.meas.base.noiseReplacer.NoiseReplacer.noiseSeedMultiplier |
Definition at line 139 of file noiseReplacer.py.
lsst.meas.base.noiseReplacer.NoiseReplacer.noiseSource |
Definition at line 137 of file noiseReplacer.py.
lsst.meas.base.noiseReplacer.NoiseReplacer.otherbitmask |
Definition at line 170 of file noiseReplacer.py.
lsst.meas.base.noiseReplacer.NoiseReplacer.removeplanes |
Definition at line 152 of file noiseReplacer.py.