lsst.afw gf03f0b42f3+45adbcf3d0
Loading...
Searching...
No Matches
lsst.afw.detection.multiband.MultibandFootprint Class Reference
Inheritance diagram for lsst.afw.detection.multiband.MultibandFootprint:
lsst.afw.multiband.MultibandBase

Public Member Functions

 __init__ (self, bands, singles)
 
 getSpans (self)
 
 footprint (self)
 
 mMaskedImage (self)
 
 spans (self)
 
 getPeaks (self)
 
 peaks (self)
 
 getImage (self, bbox=None, fill=np.nan, imageType=MultibandMaskedImage)
 
 clone (self, deep=True)
 
 y0 (self)
 
 x0 (self)
 
 bands (self)
 
 singles (self)
 
 getBBox (self)
 
 getXY0 (self)
 
 origin (self)
 
 width (self)
 
 height (self)
 
 __len__ (self)
 
 __getitem__ (self, args)
 
 __iter__ (self)
 
 __next__ (self)
 
 setXY0 (self, xy0)
 
 shiftedTo (self, xy0)
 
 shiftedBy (self, offset)
 
 __repr__ (self)
 
 __str__ (self)
 

Static Public Member Functions

 fromArrays (bands, image, mask=None, variance=None, footprint=None, xy0=None, thresh=0, peaks=None)
 
 fromImages (bands, image, mask=None, variance=None, footprint=None, thresh=0, peaks=None)
 
 fromMaskedImages (bands, maskedImages, footprint=None, thresh=0, peaks=None)
 

Public Attributes

 y0
 
 x0
 
 bands
 
 singles = Box2I(xy0, self._bbox.getDimensions())
 
 array
 

Protected Member Functions

 _slice (self, bands, bandIndex, indices)
 
 _bandNamesToIndex (self, bandIndex)
 

Protected Attributes

 _footprint = footprint
 
 _bands = tuple([f for f in bands])
 
 _singles = tuple(singles)
 
 _bbox = self._singles[0].getBBox()
 
int _bandIndex = 0
 

Detailed Description

Multiband Footprint class

A `MultibandFootprint` is a collection of HeavyFootprints that have
the same `SpanSet` and `peakCatalog` but different flux in each band.

Parameters
----------
bands : `list`
    List of band names.
singles : `list`
    A list of single band `HeavyFootprint` objects.
    Each `HeavyFootprint` should have the same `PeakCatalog`
    and the same `SpanSet`, however to save CPU cycles there
    is no internal check for consistency of the peak catalog.

Definition at line 83 of file multiband.py.

Constructor & Destructor Documentation

◆ __init__()

lsst.afw.detection.multiband.MultibandFootprint.__init__ ( self,
bands,
singles )

Definition at line 99 of file multiband.py.

Member Function Documentation

◆ __getitem__()

lsst.afw.multiband.MultibandBase.__getitem__ ( self,
args )
inherited
Get a slice of the underlying array

If only a single band is specified,
return the single band object sliced
appropriately.

Definition at line 147 of file multiband.py.

◆ __iter__()

lsst.afw.multiband.MultibandBase.__iter__ ( self)
inherited

Definition at line 172 of file multiband.py.

◆ __len__()

lsst.afw.multiband.MultibandBase.__len__ ( self)
inherited

Definition at line 144 of file multiband.py.

◆ __next__()

lsst.afw.multiband.MultibandBase.__next__ ( self)
inherited

Definition at line 176 of file multiband.py.

◆ __repr__()

lsst.afw.multiband.MultibandBase.__repr__ ( self)
inherited

Definition at line 310 of file multiband.py.

◆ __str__()

lsst.afw.multiband.MultibandBase.__str__ ( self)
inherited

Definition at line 315 of file multiband.py.

◆ _bandNamesToIndex()

lsst.afw.multiband.MultibandBase._bandNamesToIndex ( self,
bandIndex )
protectedinherited
Convert a list of band names to an index or a slice

Parameters
----------
bandIndex: iterable or `object`
    Index to specify a band or list of bands,
    usually a string or enum.
    For example `bandIndex` can be
    `"R"` or `["R", "G", "B"]` or `[Band.R, Band.G, Band.B]`,
    if `Band` is an enum.

Returns
-------
bandNames: `list`
    Names of the bands in the slice
bandIndex: `slice` or `list` of `int`
    Index of each band in `bandNames` in
    `self.bands`.

Definition at line 184 of file multiband.py.

◆ _slice()

lsst.afw.detection.multiband.MultibandFootprint._slice ( self,
bands,
bandIndex,
indices )
protected
Slice the current object and return the result

`MultibandFootprint` objects cannot be sliced along the image
dimension, so an error is thrown if `indices` has any elements.

See `Multiband._slice` for a list of the parameters.

Reimplemented from lsst.afw.multiband.MultibandBase.

Definition at line 255 of file multiband.py.

◆ bands()

lsst.afw.multiband.MultibandBase.bands ( self)
inherited
List of band names for the single band objects

Definition at line 86 of file multiband.py.

◆ clone()

lsst.afw.detection.multiband.MultibandFootprint.clone ( self,
deep = True )
Copy the current object

Parameters
----------
deep : `bool`
    Whether or not to make a deep copy

Returns
-------
result : `MultibandFootprint`
    The cloned footprint.

Reimplemented from lsst.afw.multiband.MultibandBase.

Definition at line 312 of file multiband.py.

◆ footprint()

lsst.afw.detection.multiband.MultibandFootprint.footprint ( self)
Common SpanSet and peak catalog for the single band footprints

Definition at line 232 of file multiband.py.

◆ fromArrays()

lsst.afw.detection.multiband.MultibandFootprint.fromArrays ( bands,
image,
mask = None,
variance = None,
footprint = None,
xy0 = None,
thresh = 0,
peaks = None )
static
Create a `MultibandFootprint` from an `image`, `mask`, `variance`

Parameters
----------
bands : `list`
    List of band names.
image: array
    An array to convert into `lsst.afw.detection.HeavyFootprint` objects.
    Only pixels above the `thresh` value for at least one band
    will be included in the `SpanSet` and resulting footprints.
mask : array
    Mask for the `image` array.
variance : array
    Variance of the `image` array.
footprint : `Footprint`
    `Footprint` that contains the `SpanSet` and `PeakCatalog`
    to use for the `HeavyFootprint` in each band.
    If `footprint` is `None` then the `thresh` is used to create a
    `Footprint` based on the pixels above the `thresh` value.
xy0 : `Point2I`
    If `image` is an array and `footprint` is `None` then specifying
    `xy0` gives the location of the minimum `x` and `y` value of the
    `images`.
thresh : `float` or list of floats
    Threshold in each band (or the same threshold to be used in all bands)
    to include a pixel in the `SpanSet` of the `MultibandFootprint`.
    If `Footprint` is not `None` then `thresh` is ignored.
peaks : `PeakCatalog`
    Catalog containing information about the peaks located in the
    footprints.

Returns
-------
result : `MultibandFootprint`
    MultibandFootprint created from the arrays

Definition at line 112 of file multiband.py.

◆ fromImages()

lsst.afw.detection.multiband.MultibandFootprint.fromImages ( bands,
image,
mask = None,
variance = None,
footprint = None,
thresh = 0,
peaks = None )
static
Create a `MultibandFootprint` from an `image`, `mask`, `variance`

Parameters
----------
bands : `list`
    List of band names.
image : `lsst.afw.image.MultibandImage`, or list of `lsst.afw.image.Image`
    A `lsst.afw.image.MultibandImage` (or collection of images in each band)
    to convert into `HeavyFootprint` objects.
    Only pixels above the `thresh` value for at least one band
    will be included in the `SpanSet` and resulting footprints.
mask : `MultibandMask` or list of `Mask`
    Mask for the `image`.
variance : `lsst.afw.image.MultibandImage`, or list of `lsst.afw.image.Image`
    Variance of the `image`.
thresh : `float` or `list` of floats
    Threshold in each band (or the same threshold to be used in all bands)
    to include a pixel in the `SpanSet` of the `MultibandFootprint`.
    If `Footprint` is not `None` then `thresh` is ignored.
peaks : `PeakCatalog`
    Catalog containing information about the peaks located in the
    footprints.

Returns
-------
result : `MultibandFootprint`
    MultibandFootprint created from the image, mask, and variance

Definition at line 163 of file multiband.py.

◆ fromMaskedImages()

lsst.afw.detection.multiband.MultibandFootprint.fromMaskedImages ( bands,
maskedImages,
footprint = None,
thresh = 0,
peaks = None )
static
Create a `MultibandFootprint` from a list of `MaskedImage`

See `fromImages` for a description of the parameters not listed below

Parameters
----------
maskedImages : `list` of `lsst.afw.image.MaskedImage`
    MaskedImages to extract the single band heavy footprints from.
    Like `fromImages`, if a `footprint` is not specified then all
    pixels above `thresh` will be used, and `peaks` will be added
    to the `PeakCatalog`.

Returns
-------
result : `MultibandFootprint`
    MultibandFootprint created from the image, mask, and variance

Definition at line 204 of file multiband.py.

◆ getBBox()

lsst.afw.multiband.MultibandBase.getBBox ( self)
inherited

◆ getImage()

lsst.afw.detection.multiband.MultibandFootprint.getImage ( self,
bbox = None,
fill = np.nan,
imageType = MultibandMaskedImage )
Convert a `MultibandFootprint` to a `MultibandImage`

This returns the heavy footprints converted into an `MultibandImage` or
`MultibandMaskedImage` (depending on `imageType`).
This might be different than the internal `mMaskedImage` property
of the `MultibandFootprint`, as the `mMaskedImage` might contain
some non-zero pixels not contained in the footprint but present in
the images.

Parameters
----------
bbox : `Box2I`
    Bounding box of the resulting image.
    If no bounding box is specified, then the bounding box
    of the footprint is used.
fill : `float`
    Value to use for any pixel in the resulting image
    outside of the `SpanSet`.
imageType : `type`
    This should be either a `MultibandMaskedImage`
    or `MultibandImage` and describes the type of the output image.

Returns
-------
result : `MultibandBase`
    The resulting `MultibandImage` or `MultibandMaskedImage` created
    from the `MultibandHeavyFootprint`.

Definition at line 273 of file multiband.py.

◆ getPeaks()

lsst.afw.detection.multiband.MultibandFootprint.getPeaks ( self)
Get the `PeakCatalog`

Definition at line 246 of file multiband.py.

◆ getSpans()

lsst.afw.detection.multiband.MultibandFootprint.getSpans ( self)
Get the full `SpanSet`

Definition at line 227 of file multiband.py.

◆ getXY0()

lsst.afw.multiband.MultibandBase.getXY0 ( self)
inherited
Minimum coordinate in the bounding box

Definition at line 102 of file multiband.py.

◆ height()

lsst.afw.multiband.MultibandBase.height ( self)
inherited
Height of the images

Definition at line 139 of file multiband.py.

◆ mMaskedImage()

lsst.afw.detection.multiband.MultibandFootprint.mMaskedImage ( self)
MultibandMaskedImage that the footprints present a view into

Definition at line 237 of file multiband.py.

◆ origin()

lsst.afw.multiband.MultibandBase.origin ( self)
inherited
Minimum (y,x) position

This is the position of `self.getBBox().getMin()`,
but available as a tuple for numpy array indexing.

Definition at line 124 of file multiband.py.

◆ peaks()

lsst.afw.detection.multiband.MultibandFootprint.peaks ( self)
`PeakCatalog` of the `MultibandFootprint`

Definition at line 251 of file multiband.py.

◆ setXY0()

lsst.afw.multiband.MultibandBase.setXY0 ( self,
xy0 )
inherited
Shift the bounding box but keep the same Extent

Parameters
----------
xy0: `Point2I`
    New minimum bounds of the bounding box

Reimplemented in lsst.afw.image._image._multiband.MultibandTripleBase.

Definition at line 228 of file multiband.py.

◆ shiftedBy()

lsst.afw.multiband.MultibandBase.shiftedBy ( self,
offset )
inherited
Shift a bounding box by an offset, but keep the same Extent

This method is broken until DM-10781 is completed.

Parameters
----------
offset: `Extent2I`
    Amount to shift the bounding box in x and y.

Returns
-------
result: `MultibandBase`
    A copy of the object, shifted by `offset`

Definition at line 262 of file multiband.py.

◆ shiftedTo()

lsst.afw.multiband.MultibandBase.shiftedTo ( self,
xy0 )
inherited
Shift the bounding box but keep the same Extent

This method is broken until DM-10781 is completed.

Parameters
----------
xy0: `Point2I`
    New minimum bounds of the bounding box

Returns
-------
result: `MultibandBase`
    A copy of the object, shifted to `xy0`.

Reimplemented in lsst.afw.image._image._multiband.MultibandTripleBase.

Definition at line 240 of file multiband.py.

◆ singles()

lsst.afw.multiband.MultibandBase.singles ( self)
inherited
List of single band objects

Definition at line 92 of file multiband.py.

◆ spans()

lsst.afw.detection.multiband.MultibandFootprint.spans ( self)
`SpanSet` of the `MultibandFootprint`

Definition at line 242 of file multiband.py.

◆ width()

lsst.afw.multiband.MultibandBase.width ( self)
inherited
Width of the images

Definition at line 133 of file multiband.py.

◆ x0()

lsst.afw.multiband.MultibandBase.x0 ( self)
inherited
X0

X component of XY0 `Point2I.getX()`

Definition at line 108 of file multiband.py.

◆ y0()

lsst.afw.multiband.MultibandBase.y0 ( self)
inherited
Y0

Y component of XY0 `Point2I.getY()`

Definition at line 116 of file multiband.py.

Member Data Documentation

◆ _bandIndex

int lsst.afw.multiband.MultibandBase._bandIndex = 0
protectedinherited

Definition at line 173 of file multiband.py.

◆ _bands

lsst.afw.multiband.MultibandBase._bands = tuple([f for f in bands])
protectedinherited

Definition at line 55 of file multiband.py.

◆ _bbox

lsst.afw.multiband.MultibandBase._bbox = self._singles[0].getBBox()
protectedinherited

Definition at line 59 of file multiband.py.

◆ _footprint

lsst.afw.detection.multiband.MultibandFootprint._footprint = footprint
protected

Definition at line 109 of file multiband.py.

◆ _singles

lsst.afw.multiband.MultibandBase._singles = tuple(singles)
protectedinherited

Definition at line 56 of file multiband.py.

◆ array

lsst.afw.multiband.MultibandBase.array
inherited

Definition at line 317 of file multiband.py.

◆ bands

lsst.afw.multiband.MultibandBase.bands
inherited

Definition at line 145 of file multiband.py.

◆ singles

lsst.afw.multiband.MultibandBase.singles = Box2I(xy0, self._bbox.getDimensions())
inherited

Definition at line 237 of file multiband.py.

◆ x0

lsst.afw.multiband.MultibandBase.x0
inherited

Definition at line 130 of file multiband.py.

◆ y0

lsst.afw.multiband.MultibandBase.y0
inherited

Definition at line 130 of file multiband.py.


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