LSSTApplications
10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
|
Class that handles replacing sources with noise during measurement. More...
Public Member Functions | |
def | __init__ |
Initialize the NoiseReplacer. More... | |
def | insertSource |
Insert the heavy footprint of a given source into the exposure. More... | |
def | removeSource |
Remove the heavy footprint of a given source and replace with previous noise. More... | |
def | end |
End the NoiseReplacer. More... | |
def | getNoiseGenerator |
Generate noise image using parameters given. More... | |
Public Attributes | |
noiseSource | |
noiseOffset | |
noiseSeedMultiplier | |
noiseGenMean | |
noiseGenStd | |
log | |
exposure | |
footprints | |
removeplanes | |
otherbitmask | |
heavies | |
heavyNoise | |
FIXME: the heavy footprint includes the mask and variance planes, which we shouldn't need (I don't think we ever want to modify them in the input image). More... | |
Static Public Attributes | |
ConfigClass = NoiseReplacerConfig | |
Class that handles replacing sources with noise during measurement.
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 HeavyFootprints attached to the SourceRecords. The algorithm works as follows:
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 a Task, as the lifetime of a NoiseReplacer now corresponds to a single exposure, not an entire processing run.
Definition at line 52 of file noiseReplacer.py.
def lsst.meas.base.noiseReplacer.NoiseReplacer.__init__ | ( | self, | |
config, | |||
exposure, | |||
footprints, | |||
noiseImage = None , |
|||
exposureId = None , |
|||
log = None |
|||
) |
Initialize the NoiseReplacer.
[in] | config | instance of NoiseReplacerConfig |
[in,out] | exposure | Exposure to be noise replaced. (All sources replaced on return) |
[in] | footprints | dict of {id: (parent, footprint)}; |
[in] | noiseImage | an afw.image.ImageF used as a predictable noise replacement source (for tests only) |
[in] | log | pex.logging.Log object to use for status messages; no status messages will be printed if None |
'footprints' is a dict of {id: (parent, footprint)}; when used in SFM, the ID will be the source ID, but in forced photometry, this will be the reference ID, as that's what we used to determine the deblend families. This routine should create HeavyFootprints for any non-Heavy Footprints, and replace them in the dict. It should then create a dict of HeavyFootprints 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.
NOTE: 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 74 of file noiseReplacer.py.
def lsst.meas.base.noiseReplacer.NoiseReplacer.end | ( | self | ) |
End the NoiseReplacer.
Restore original data to the exposure from the heavies dictionary Restore the mask planes to their original state
Definition at line 225 of file noiseReplacer.py.
def lsst.meas.base.noiseReplacer.NoiseReplacer.getNoiseGenerator | ( | self, | |
exposure, | |||
noiseImage, | |||
noiseMeanVar, | |||
exposureId = None |
|||
) |
Generate noise image using parameters given.
Definition at line 250 of file noiseReplacer.py.
def lsst.meas.base.noiseReplacer.NoiseReplacer.insertSource | ( | self, | |
id | |||
) |
Insert the heavy footprint of a given source into the exposure.
[in] | id | id for current source to insert from original footprint dict |
Also adjusts the mask plane to show the source of this footprint.
Definition at line 175 of file noiseReplacer.py.
def lsst.meas.base.noiseReplacer.NoiseReplacer.removeSource | ( | self, | |
id | |||
) |
Remove the heavy footprint of a given source and replace with previous noise.
[in] | id | id for current source to insert from original footprint dict |
Also restore the mask plane.
Definition at line 198 of file noiseReplacer.py.
|
static |
Definition at line 72 of file noiseReplacer.py.
lsst.meas.base.noiseReplacer.NoiseReplacer.exposure |
Definition at line 109 of file noiseReplacer.py.
lsst.meas.base.noiseReplacer.NoiseReplacer.footprints |
Definition at line 110 of file noiseReplacer.py.
lsst.meas.base.noiseReplacer.NoiseReplacer.heavies |
Definition at line 133 of file noiseReplacer.py.
lsst.meas.base.noiseReplacer.NoiseReplacer.heavyNoise |
FIXME: the heavy footprint includes the mask and variance planes, which we shouldn't need (I don't think we ever want to modify them in the input image).
Copying them around is wasteful.
Definition at line 158 of file noiseReplacer.py.
lsst.meas.base.noiseReplacer.NoiseReplacer.log |
Definition at line 105 of file noiseReplacer.py.
lsst.meas.base.noiseReplacer.NoiseReplacer.noiseGenMean |
Definition at line 103 of file noiseReplacer.py.
lsst.meas.base.noiseReplacer.NoiseReplacer.noiseGenStd |
Definition at line 104 of file noiseReplacer.py.
lsst.meas.base.noiseReplacer.NoiseReplacer.noiseOffset |
Definition at line 101 of file noiseReplacer.py.
lsst.meas.base.noiseReplacer.NoiseReplacer.noiseSeedMultiplier |
Definition at line 102 of file noiseReplacer.py.
lsst.meas.base.noiseReplacer.NoiseReplacer.noiseSource |
Definition at line 100 of file noiseReplacer.py.
lsst.meas.base.noiseReplacer.NoiseReplacer.otherbitmask |
Definition at line 131 of file noiseReplacer.py.
lsst.meas.base.noiseReplacer.NoiseReplacer.removeplanes |
Definition at line 115 of file noiseReplacer.py.