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 | 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: