lsst.meas.base  16.0-17-g7e0e4ff+2
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lsst.meas.base.noiseReplacer.NoiseReplacer Class Reference

Class that handles replacing sources with noise during measurement. More...

Public Member Functions

def __init__ (self, config, exposure, footprints, noiseImage=None, exposureId=None, log=None)
 Initialize the NoiseReplacer. More...
 
def insertSource (self, id)
 Insert the heavy footprint of a given source into the exposure. More...
 
def removeSource (self, id)
 Remove the heavy footprint of a given source and replace with previous noise. More...
 
def end (self)
 End the NoiseReplacer. More...
 
def getNoiseGenerator (self, exposure, noiseImage, noiseMeanVar, exposureId=None)
 Generate noise image using parameters given. More...
 

Public Attributes

 noiseSource
 
 noiseOffset
 
 noiseSeedMultiplier
 
 noiseGenMean
 
 noiseGenStd
 
 log
 
 exposure
 
 footprints
 
 removeplanes
 
 otherbitmask
 
 heavies
 
 heavyNoise
 

Static Public Attributes

 ConfigClass = NoiseReplacerConfig
 

Detailed Description

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 57 of file noiseReplacer.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.meas.base.noiseReplacer.NoiseReplacer.__init__ (   self,
  config,
  exposure,
  footprints,
  noiseImage = None,
  exposureId = None,
  log = None 
)

Initialize the NoiseReplacer.

Parameters
[in]configinstance of NoiseReplacerConfig
[in,out]exposureExposure to be noise replaced. (All sources replaced on return)
[in]footprintsdict of {id: (parent, footprint)};
[in]noiseImagean afw.image.ImageF used as a predictable noise replacement source (for tests only)
[in]logLog 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 79 of file noiseReplacer.py.

Member Function Documentation

◆ end()

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 232 of file noiseReplacer.py.

◆ getNoiseGenerator()

def lsst.meas.base.noiseReplacer.NoiseReplacer.getNoiseGenerator (   self,
  exposure,
  noiseImage,
  noiseMeanVar,
  exposureId = None 
)

Generate noise image using parameters given.

Definition at line 257 of file noiseReplacer.py.

◆ insertSource()

def lsst.meas.base.noiseReplacer.NoiseReplacer.insertSource (   self,
  id 
)

Insert the heavy footprint of a given source into the exposure.

Parameters
[in]idid for current source to insert from original footprint dict

Also adjusts the mask plane to show the source of this footprint.

Definition at line 182 of file noiseReplacer.py.

◆ removeSource()

def lsst.meas.base.noiseReplacer.NoiseReplacer.removeSource (   self,
  id 
)

Remove the heavy footprint of a given source and replace with previous noise.

Parameters
[in]idid for current source to insert from original footprint dict

Also restore the mask plane.

Definition at line 205 of file noiseReplacer.py.

Member Data Documentation

◆ ConfigClass

lsst.meas.base.noiseReplacer.NoiseReplacer.ConfigClass = NoiseReplacerConfig
static

Definition at line 77 of file noiseReplacer.py.

◆ exposure

lsst.meas.base.noiseReplacer.NoiseReplacer.exposure

Definition at line 114 of file noiseReplacer.py.

◆ footprints

lsst.meas.base.noiseReplacer.NoiseReplacer.footprints

Definition at line 115 of file noiseReplacer.py.

◆ heavies

lsst.meas.base.noiseReplacer.NoiseReplacer.heavies

Definition at line 140 of file noiseReplacer.py.

◆ heavyNoise

lsst.meas.base.noiseReplacer.NoiseReplacer.heavyNoise

Definition at line 164 of file noiseReplacer.py.

◆ log

lsst.meas.base.noiseReplacer.NoiseReplacer.log

Definition at line 110 of file noiseReplacer.py.

◆ noiseGenMean

lsst.meas.base.noiseReplacer.NoiseReplacer.noiseGenMean

Definition at line 108 of file noiseReplacer.py.

◆ noiseGenStd

lsst.meas.base.noiseReplacer.NoiseReplacer.noiseGenStd

Definition at line 109 of file noiseReplacer.py.

◆ noiseOffset

lsst.meas.base.noiseReplacer.NoiseReplacer.noiseOffset

Definition at line 106 of file noiseReplacer.py.

◆ noiseSeedMultiplier

lsst.meas.base.noiseReplacer.NoiseReplacer.noiseSeedMultiplier

Definition at line 107 of file noiseReplacer.py.

◆ noiseSource

lsst.meas.base.noiseReplacer.NoiseReplacer.noiseSource

Definition at line 105 of file noiseReplacer.py.

◆ otherbitmask

lsst.meas.base.noiseReplacer.NoiseReplacer.otherbitmask

Definition at line 138 of file noiseReplacer.py.

◆ removeplanes

lsst.meas.base.noiseReplacer.NoiseReplacer.removeplanes

Definition at line 120 of file noiseReplacer.py.


The documentation for this class was generated from the following file: