LSST Applications g0265f82a02+0e5473021a,g02d81e74bb+0dd8ce4237,g1470d8bcf6+3ea6592b6f,g2079a07aa2+86d27d4dc4,g2305ad1205+5ca4c0b359,g295015adf3+d10818ec9d,g2a9a014e59+6f9be1b9cd,g2bbee38e9b+0e5473021a,g337abbeb29+0e5473021a,g3ddfee87b4+703ba97ebf,g487adcacf7+4fa16da234,g50ff169b8f+96c6868917,g52b1c1532d+585e252eca,g591dd9f2cf+ffa42b374e,g5a732f18d5+53520f316c,g64a986408d+0dd8ce4237,g858d7b2824+0dd8ce4237,g8a8a8dda67+585e252eca,g99cad8db69+d39438377f,g9ddcbc5298+9a081db1e4,ga1e77700b3+15fc3df1f7,ga8c6da7877+f1d96605c8,gb0e22166c9+60f28cb32d,gb6a65358fc+0e5473021a,gba4ed39666+c2a2e4ac27,gbb8dafda3b+e5339d463f,gc120e1dc64+da31e9920e,gc28159a63d+0e5473021a,gcf0d15dbbd+703ba97ebf,gdaeeff99f8+f9a426f77a,ge6526c86ff+889fc9d533,ge79ae78c31+0e5473021a,gee10cc3b42+585e252eca,gf18bd8381d+7268b93478,gff1a9f87cc+0dd8ce4237,w.2024.16
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
lsst.meas.deblender.baseline.DeblendedParent Class Reference

Public Member Functions

 __init__ (self, filterName, footprint, maskedImage, psf, psffwhm, avgNoise, maxNumberOfPeaks, debResult)
 
 updateFootprintBbox (self)
 

Public Attributes

 filter
 
 fp
 
 maskedImage
 
 psf
 
 psffwhm
 
 img
 
 imbb
 
 varimg
 
 mask
 
 avgNoise
 
 debResult
 
 peakCount
 
 templateSum
 
 peaks
 
 bb
 
 W
 
 H
 
 x0
 
 y0
 
 x1
 
 y1
 

Detailed Description

Deblender result of a single parent footprint, in a single band

Convenience class to store useful objects used by the deblender for a single band,
such as the maskedImage, psf, etc as well as the results from the deblender.

Parameters
----------
filterName: `str`
    Name of the filter used for `maskedImage`
footprint: list of `afw.detection.Footprint`s
    Parent footprint to deblend in each band.
maskedImages: list of `afw.image.MaskedImageF`s
    Masked image containing the ``footprint`` in each band.
psf: list of `afw.detection.Psf`s
    Psf of the ``maskedImage`` for each band.
psffwhm: list of `float`s
    FWHM of the ``maskedImage``'s ``psf`` in each band.
avgNoise: `float`or list of `float`s, optional
    Average noise level in each ``maskedImage``.
    The default is ``None``, which estimates the noise from the median value of the
    variance plane of ``maskedImage`` for each filter.
maxNumberOfPeaks: `int`, optional
    If positive, the maximum number of peaks to deblend.
    If the total number of peaks is greater than ``maxNumberOfPeaks``,
    then only the first ``maxNumberOfPeaks`` sources are deblended.
    The default is 0, which deblends all of the peaks.
debResult: `DeblenderResult`
    The ``DeblenderResult`` that contains this ``DeblendedParent``.

Definition at line 148 of file baseline.py.

Constructor & Destructor Documentation

◆ __init__()

lsst.meas.deblender.baseline.DeblendedParent.__init__ ( self,
filterName,
footprint,
maskedImage,
psf,
psffwhm,
avgNoise,
maxNumberOfPeaks,
debResult )

Definition at line 178 of file baseline.py.

179 maxNumberOfPeaks, debResult):
180 self.filter = filterName
181 self.fp = footprint
182 self.maskedImage = maskedImage
183 self.psf = psf
184 self.psffwhm = psffwhm
185 self.img = maskedImage.getImage()
186 self.imbb = self.img.getBBox()
187 self.varimg = maskedImage.getVariance()
188 self.mask = maskedImage.getMask()
189 self.avgNoise = avgNoise
190 self.updateFootprintBbox()
191 self.debResult = debResult
192 self.peakCount = debResult.peakCount
193 self.templateSum = None
194
195 # avgNoise is an estiamte of the average noise level for the image in this filter
196 if avgNoise is None:
197 stats = afwMath.makeStatistics(self.varimg, self.mask, afwMath.MEDIAN)
198 avgNoise = np.sqrt(stats.getValue(afwMath.MEDIAN))
199 debResult.log.trace('Estimated avgNoise for filter %s = %f', self.filter, avgNoise)
200 self.avgNoise = avgNoise
201
202 # Store all of the peak information in a single object
203 self.peaks = []
204 peaks = self.fp.getPeaks()
205 for idx in range(self.peakCount):
206 deblendedPeak = DeblendedPeak(peaks[idx], idx, self)
207 self.peaks.append(deblendedPeak)
208
Statistics makeStatistics(lsst::afw::image::Image< Pixel > const &img, lsst::afw::image::Mask< image::MaskPixel > const &msk, int const flags, StatisticsControl const &sctrl=StatisticsControl())
Handle a watered-down front-end to the constructor (no variance)
Definition Statistics.h:361

Member Function Documentation

◆ updateFootprintBbox()

lsst.meas.deblender.baseline.DeblendedParent.updateFootprintBbox ( self)
Update the bounding box of the parent footprint

If the parent Footprint is resized it will be necessary to update the bounding box of the footprint.

Definition at line 209 of file baseline.py.

209 def updateFootprintBbox(self):
210 """Update the bounding box of the parent footprint
211
212 If the parent Footprint is resized it will be necessary to update the bounding box of the footprint.
213 """
214 # Pull out the image bounds of the parent Footprint
215 self.bb = self.fp.getBBox()
216 if not self.imbb.contains(self.bb):
217 raise ValueError(('Footprint bounding-box %s extends outside image bounding-box %s') %
218 (str(self.bb), str(self.imbb)))
219 self.W, self.H = self.bb.getWidth(), self.bb.getHeight()
220 self.x0, self.y0 = self.bb.getMinX(), self.bb.getMinY()
221 self.x1, self.y1 = self.bb.getMaxX(), self.bb.getMaxY()
222
223

Member Data Documentation

◆ avgNoise

lsst.meas.deblender.baseline.DeblendedParent.avgNoise

Definition at line 189 of file baseline.py.

◆ bb

lsst.meas.deblender.baseline.DeblendedParent.bb

Definition at line 215 of file baseline.py.

◆ debResult

lsst.meas.deblender.baseline.DeblendedParent.debResult

Definition at line 191 of file baseline.py.

◆ filter

lsst.meas.deblender.baseline.DeblendedParent.filter

Definition at line 180 of file baseline.py.

◆ fp

lsst.meas.deblender.baseline.DeblendedParent.fp

Definition at line 181 of file baseline.py.

◆ H

lsst.meas.deblender.baseline.DeblendedParent.H

Definition at line 219 of file baseline.py.

◆ imbb

lsst.meas.deblender.baseline.DeblendedParent.imbb

Definition at line 186 of file baseline.py.

◆ img

lsst.meas.deblender.baseline.DeblendedParent.img

Definition at line 185 of file baseline.py.

◆ mask

lsst.meas.deblender.baseline.DeblendedParent.mask

Definition at line 188 of file baseline.py.

◆ maskedImage

lsst.meas.deblender.baseline.DeblendedParent.maskedImage

Definition at line 182 of file baseline.py.

◆ peakCount

lsst.meas.deblender.baseline.DeblendedParent.peakCount

Definition at line 192 of file baseline.py.

◆ peaks

lsst.meas.deblender.baseline.DeblendedParent.peaks

Definition at line 203 of file baseline.py.

◆ psf

lsst.meas.deblender.baseline.DeblendedParent.psf

Definition at line 183 of file baseline.py.

◆ psffwhm

lsst.meas.deblender.baseline.DeblendedParent.psffwhm

Definition at line 184 of file baseline.py.

◆ templateSum

lsst.meas.deblender.baseline.DeblendedParent.templateSum

Definition at line 193 of file baseline.py.

◆ varimg

lsst.meas.deblender.baseline.DeblendedParent.varimg

Definition at line 187 of file baseline.py.

◆ W

lsst.meas.deblender.baseline.DeblendedParent.W

Definition at line 219 of file baseline.py.

◆ x0

lsst.meas.deblender.baseline.DeblendedParent.x0

Definition at line 220 of file baseline.py.

◆ x1

lsst.meas.deblender.baseline.DeblendedParent.x1

Definition at line 221 of file baseline.py.

◆ y0

lsst.meas.deblender.baseline.DeblendedParent.y0

Definition at line 220 of file baseline.py.

◆ y1

lsst.meas.deblender.baseline.DeblendedParent.y1

Definition at line 221 of file baseline.py.


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