LSST Applications 27.0.0,g0265f82a02+469cd937ee,g02d81e74bb+21ad69e7e1,g1470d8bcf6+cbe83ee85a,g2079a07aa2+e67c6346a6,g212a7c68fe+04a9158687,g2305ad1205+94392ce272,g295015adf3+81dd352a9d,g2bbee38e9b+469cd937ee,g337abbeb29+469cd937ee,g3939d97d7f+72a9f7b576,g487adcacf7+71499e7cba,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+df404f777f,g5a732f18d5+be83d3ecdb,g64a986408d+21ad69e7e1,g858d7b2824+21ad69e7e1,g8a8a8dda67+a6fc98d2e7,g99cad8db69+f62e5b0af5,g9ddcbc5298+d4bad12328,ga1e77700b3+9c366c4306,ga8c6da7877+71e4819109,gb0e22166c9+25ba2f69a1,gb6a65358fc+469cd937ee,gbb8dafda3b+69d3c0e320,gc07e1c2157+a98bf949bb,gc120e1dc64+615ec43309,gc28159a63d+469cd937ee,gcf0d15dbbd+72a9f7b576,gdaeeff99f8+a38ce5ea23,ge6526c86ff+3a7c1ac5f1,ge79ae78c31+469cd937ee,gee10cc3b42+a6fc98d2e7,gf1cff7945b+21ad69e7e1,gfbcc870c63+9a11dc8c8f
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
lsst.pipe.tasks.background.MaskObjectsTask Class Reference
Inheritance diagram for lsst.pipe.tasks.background.MaskObjectsTask:

Public Member Functions

 __init__ (self, *args, **kwargs)
 
 run (self, exposure, maskPlanes=None)
 
 findObjects (self, exposure)
 
 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 803 of file background.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 816 of file background.py.

816 def __init__(self, *args, **kwargs):
817 super().__init__(*args, **kwargs)
818 # Disposable schema suppresses warning from SourceDetectionTask.__init__
819 self.makeSubtask("detection", schema=afwTable.Schema())
820 self.makeSubtask("interpolate")
821 self.makeSubtask("subtractBackground")
822
Defines the fields and offsets for a table.
Definition Schema.h:51

Member Function Documentation

◆ findObjects()

lsst.pipe.tasks.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 838 of file background.py.

838 def findObjects(self, exposure):
839 """Iteratively find objects on an exposure
840
841 Objects are masked with the ``DETECTED`` mask plane.
842
843 Parameters
844 ----------
845 exposure : `lsst.afw.image.Exposure`
846 Exposure on which to mask objects.
847 """
848 for _ in range(self.config.nIter):
849 bg = self.subtractBackground.run(exposure).background
850 self.detection.detectFootprints(exposure, sigma=self.config.detectSigma, clearMask=True)
851 exposure.maskedImage += bg.getImage()
852

◆ removeObjects()

lsst.pipe.tasks.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 853 of file background.py.

853 def removeObjects(self, exposure, maskPlanes=None):
854 """Remove objects from exposure
855
856 We interpolate over using a background model if ``doInterpolate`` is
857 set; otherwise we simply replace everything with the median.
858
859 Parameters
860 ----------
861 exposure : `lsst.afw.image.Exposure`
862 Exposure on which to mask objects.
863 maskPlanes : iterable of `str`, optional
864 List of mask planes to remove. ``DETECTED`` will be added as well.
865 """
866 image = exposure.image
867 mask = exposure.mask
868 maskVal = mask.getPlaneBitMask("DETECTED")
869 if maskPlanes is not None:
870 maskVal |= mask.getPlaneBitMask(maskPlanes)
871 isBad = mask.array & maskVal > 0
872
873 if self.config.doInterpolate:
874 smooth = self.interpolate.fitBackground(exposure.maskedImage)
875 replace = smooth.getImageF().array[isBad]
876 mask.array &= ~mask.getPlaneBitMask(["DETECTED"])
877 else:
878 replace = numpy.median(image.array[~isBad])
879 image.array[isBad] = replace
880
881

◆ run()

lsst.pipe.tasks.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 823 of file background.py.

823 def run(self, exposure, maskPlanes=None):
824 """Mask objects on Exposure
825
826 Objects are found and removed.
827
828 Parameters
829 ----------
830 exposure : `lsst.afw.image.Exposure`
831 Exposure on which to mask objects.
832 maskPlanes : iterable of `str`, optional
833 List of mask planes to remove.
834 """
835 self.findObjects(exposure)
836 self.removeObjects(exposure, maskPlanes)
837

Member Data Documentation

◆ ConfigClass

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

Definition at line 814 of file background.py.


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