23 from __future__
import absolute_import, division, print_function
26 import lsst.pex.config
29 from future.utils
import with_metaclass
33 maskPlaneName = lsst.pex.config.Field(
34 dtype=str, default=
"FAKE",
35 doc=
"Mask plane to set on pixels affected by fakes. Will be added if not already present." 40 """An abstract base class for subtasks that inject fake sources into images to test completeness and 41 other aspects of the processing. 43 This class simply adds a mask plane that subclasses should use to mark pixels that have been touched. 45 This is an abstract base class (abc) and is not intended to be directly used. To create a fake sources 46 injector, create a child class and re-implement the required methods. 49 ConfigClass = BaseFakeSourcesConfig
50 _DefaultName =
"baseFakeSources" 53 """Initialize the Task. 55 Subclasses that define their own __init__ should simply forward all arguments to the base 56 class constructor. They can then assume self.config is an instance of their ConfigClass. 58 If an external catalog is used to add sources consistently to multiple overlapping images, 59 that catalog should generally be loaded and attached to self here, so it can be used 60 multiple times by the run() method. 62 lsst.pipe.base.Task.__init__(self, **kwargs)
63 lsst.afw.image.Mask[lsst.afw.image.MaskPixel].addMaskPlane(self.config.maskPlaneName)
64 self.
bitmask = lsst.afw.image.Mask[lsst.afw.image.MaskPixel]\
65 .getPlaneBitMask(self.config.maskPlaneName)
68 def run(self, exposure, background):
69 """Add fake sources to the given Exposure, making use of the given BackgroundList if desired. 71 If pixels in the Exposure are replaced, not added to, extra care should be taken with the background, 72 mask, and variance planes. The Exposure as given is background-subtracted (using the supplied 73 background model) and should be returned in the same state. 75 raise NotImplementedError(
"FakeSourcesTask is abstract, create a child class to use this method")
def run(self, exposure, background)
def __init__(self, kwargs)