LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
Public Member Functions | Static Public Attributes | List of all members
lsst.pipe.drivers.background.MaskObjectsTask Class Reference
Inheritance diagram for lsst.pipe.drivers.background.MaskObjectsTask:

Public Member Functions

def __init__ (self, *args, **kwargs)
 
def run (self, exposure, maskPlanes=None)
 
def findObjects (self, exposure)
 
def removeObjects (self, exposure, maskPlanes=None)
 

Static Public Attributes

 ConfigClass = MaskObjectsConfig
 

Detailed Description

Iterative masking of objects on an Exposure

This task makes more exhaustive object mask by iteratively doing detection
and background-subtraction. The purpose of this task is to get true
background removing faint tails of large objects. This is useful to get a
clean sky estimate from relatively small number of visits.

We deliberately use the specified ``detectSigma`` instead of the PSF,
in order to better pick up the faint wings of objects.

Definition at line 770 of file background.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.pipe.drivers.background.MaskObjectsTask.__init__ (   self,
args,
**  kwargs 
)

Definition at line 783 of file background.py.

783  def __init__(self, *args, **kwargs):
784  super().__init__(*args, **kwargs)
785  # Disposable schema suppresses warning from SourceDetectionTask.__init__
786  self.makeSubtask("detection", schema=afwTable.Schema())
787  self.makeSubtask("interpolate")
788  self.makeSubtask("subtractBackground")
789 
Defines the fields and offsets for a table.
Definition: Schema.h:51

Member Function Documentation

◆ findObjects()

def lsst.pipe.drivers.background.MaskObjectsTask.findObjects (   self,
  exposure 
)
Iteratively find objects on an exposure

Objects are masked with the ``DETECTED`` mask plane.

Parameters
----------
exposure : `lsst.afw.image.Exposure`
    Exposure on which to mask objects.

Definition at line 805 of file background.py.

805  def findObjects(self, exposure):
806  """Iteratively find objects on an exposure
807 
808  Objects are masked with the ``DETECTED`` mask plane.
809 
810  Parameters
811  ----------
812  exposure : `lsst.afw.image.Exposure`
813  Exposure on which to mask objects.
814  """
815  for _ in range(self.config.nIter):
816  bg = self.subtractBackground.run(exposure).background
817  self.detection.detectFootprints(exposure, sigma=self.config.detectSigma, clearMask=True)
818  exposure.maskedImage += bg.getImage()
819 
def run(self, coaddExposures, bbox, wcs)
Definition: getTemplate.py:603

◆ removeObjects()

def lsst.pipe.drivers.background.MaskObjectsTask.removeObjects (   self,
  exposure,
  maskPlanes = None 
)
Remove objects from exposure

We interpolate over using a background model if ``doInterpolate`` is
set; otherwise we simply replace everything with the median.

Parameters
----------
exposure : `lsst.afw.image.Exposure`
    Exposure on which to mask objects.
maskPlanes : iterable of `str`, optional
    List of mask planes to remove. ``DETECTED`` will be added as well.

Definition at line 820 of file background.py.

820  def removeObjects(self, exposure, maskPlanes=None):
821  """Remove objects from exposure
822 
823  We interpolate over using a background model if ``doInterpolate`` is
824  set; otherwise we simply replace everything with the median.
825 
826  Parameters
827  ----------
828  exposure : `lsst.afw.image.Exposure`
829  Exposure on which to mask objects.
830  maskPlanes : iterable of `str`, optional
831  List of mask planes to remove. ``DETECTED`` will be added as well.
832  """
833  image = exposure.image
834  mask = exposure.mask
835  maskVal = mask.getPlaneBitMask("DETECTED")
836  if maskPlanes is not None:
837  maskVal |= mask.getPlaneBitMask(maskPlanes)
838  isBad = mask.array & maskVal > 0
839 
840  if self.config.doInterpolate:
841  smooth = self.interpolate.fitBackground(exposure.maskedImage)
842  replace = smooth.getImageF().array[isBad]
843  mask.array &= ~mask.getPlaneBitMask(["DETECTED"])
844  else:
845  replace = numpy.median(image.array[~isBad])
846  image.array[isBad] = replace
847 
848 

◆ run()

def lsst.pipe.drivers.background.MaskObjectsTask.run (   self,
  exposure,
  maskPlanes = None 
)
Mask objects on Exposure

Objects are found and removed.

Parameters
----------
exposure : `lsst.afw.image.Exposure`
    Exposure on which to mask objects.
maskPlanes : iterable of `str`, optional
    List of mask planes to remove.

Definition at line 790 of file background.py.

790  def run(self, exposure, maskPlanes=None):
791  """Mask objects on Exposure
792 
793  Objects are found and removed.
794 
795  Parameters
796  ----------
797  exposure : `lsst.afw.image.Exposure`
798  Exposure on which to mask objects.
799  maskPlanes : iterable of `str`, optional
800  List of mask planes to remove.
801  """
802  self.findObjects(exposure)
803  self.removeObjects(exposure, maskPlanes)
804 

Member Data Documentation

◆ ConfigClass

lsst.pipe.drivers.background.MaskObjectsTask.ConfigClass = MaskObjectsConfig
static

Definition at line 781 of file background.py.


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