MultibandFootprint¶
-
class
lsst.afw.detection.MultibandFootprint(filters, singles)¶ Bases:
lsst.afw.multiband.MultibandBaseMultiband Footprint class
A
MultibandFootprintis a collection of HeavyFootprints that have the sameSpanSetandpeakCatalogbut different flux in each band.Parameters: - filters :
list List of filter names.
- singles :
list A list of single band
HeavyFootprintobjects. EachHeavyFootprintshould have the samePeakCatalogand the sameSpanSet, however to save CPU cycles there is no internal check for consistency of the peak catalog.
Attributes Summary
filtersList of filter names for the single band objects footprintCommon SpanSet and peak catalog for the single band footprints heightHeight of the images mMaskedImageMultibandMaskedImage that the footprints present a view into originMinimum (y,x) position peaksPeakCatalogof theMultibandFootprintsinglesList of single band objects spansSpanSetof theMultibandFootprintwidthWidth of the images x0X0 y0Y0 Methods Summary
clone([deep])Copy the current object fromArrays(filters, image[, mask, variance, …])Create a MultibandFootprintfrom animage,mask,variancefromImages(filters, image[, mask, variance, …])Create a MultibandFootprintfrom animage,mask,variancefromMaskedImages(filters, maskedImages[, …])Create a MultibandFootprintfrom a list ofMaskedImagegetBBox()Bounding box getImage([bbox, fill, imageType])Convert a MultibandFootprintto aMultibandImagegetPeaks()Get the PeakCataloggetSpans()Get the full SpanSetgetXY0()Minimum coordinate in the bounding box setXY0(xy0)Shift the bounding box but keep the same Extent shiftedBy(offset)Shift a bounding box by an offset, but keep the same Extent shiftedTo(xy0)Shift the bounding box but keep the same Extent Attributes Documentation
-
filters¶ List of filter names for the single band objects
-
footprint¶ Common SpanSet and peak catalog for the single band footprints
-
height¶ Height of the images
-
mMaskedImage¶ MultibandMaskedImage that the footprints present a view into
-
origin¶ Minimum (y,x) position
This is the position of
self.getBBox().getMin(), but available as a tuple for numpy array indexing.
-
peaks¶ PeakCatalogof theMultibandFootprint
-
singles¶ List of single band objects
-
spans¶ SpanSetof theMultibandFootprint
-
width¶ Width of the images
-
x0¶ X0
X component of XY0
Point2I.getX()
-
y0¶ Y0
Y component of XY0
Point2I.getY()
Methods Documentation
-
clone(deep=True)¶ Copy the current object
Parameters: - deep :
bool Whether or not to make a deep copy
Returns: - result :
MultibandFootprint The cloned footprint.
- deep :
-
static
fromArrays(filters, image, mask=None, variance=None, footprint=None, xy0=None, thresh=0, peaks=None)¶ Create a
MultibandFootprintfrom animage,mask,varianceParameters: - filters :
list List of filter names.
- image: array
An array to convert into
lsst.afw.detection.HeavyFootprintobjects. Only pixels above thethreshvalue for at least one band will be included in theSpanSetand resulting footprints.- mask : array
Mask for the
imagearray.- variance : array
Variance of the
imagearray.- footprint :
Footprint Footprintthat contains theSpanSetandPeakCatalogto use for theHeavyFootprintin each band. IffootprintisNonethen thethreshis used to create aFootprintbased on the pixels above thethreshvalue.- xy0 :
Point2I If
imageis an array andfootprintisNonethen specifyingxy0gives the location of the minimumxandyvalue of theimages.- thresh :
floator list of floats Threshold in each band (or the same threshold to be used in all bands) to include a pixel in the
SpanSetof theMultibandFootprint. IfFootprintis notNonethenthreshis ignored.- peaks :
PeakCatalog Catalog containing information about the peaks located in the footprints.
Returns: - result :
MultibandFootprint MultibandFootprint created from the arrays
- filters :
-
static
fromImages(filters, image, mask=None, variance=None, footprint=None, thresh=0, peaks=None)¶ Create a
MultibandFootprintfrom animage,mask,varianceParameters: - filters :
list List of filter names.
- image :
lsst.afw.image.MultibandImage, or list oflsst.afw.image.Image A
lsst.afw.image.MultibandImage(or collection of images in each band) to convert intoHeavyFootprintobjects. Only pixels above thethreshvalue for at least one band will be included in theSpanSetand resulting footprints.- mask :
MultibandMaskor list ofMask Mask for the
image.- variance :
lsst.afw.image.MultibandImage, or list oflsst.afw.image.Image Variance of the
image.- thresh :
floatorlistof floats Threshold in each band (or the same threshold to be used in all bands) to include a pixel in the
SpanSetof theMultibandFootprint. IfFootprintis notNonethenthreshis ignored.- peaks :
PeakCatalog Catalog containing information about the peaks located in the footprints.
Returns: - result :
MultibandFootprint MultibandFootprint created from the image, mask, and variance
- filters :
-
static
fromMaskedImages(filters, maskedImages, footprint=None, thresh=0, peaks=None)¶ Create a
MultibandFootprintfrom a list ofMaskedImageSee
fromImagesfor a description of the parameters not listed belowParameters: - maskedImages :
listoflsst.afw.image.MaskedImage MaskedImages to extract the single band heavy footprints from. Like
fromImages, if afootprintis not specified then all pixels abovethreshwill be used, andpeakswill be added to thePeakCatalog.
Returns: - result :
MultibandFootprint MultibandFootprint created from the image, mask, and variance
- maskedImages :
-
getBBox()¶ Bounding box
-
getImage(bbox=None, fill=nan, imageType=<class 'lsst.afw.image.image.multiband.MultibandMaskedImage'>)¶ Convert a
MultibandFootprintto aMultibandImageThis returns the heavy footprints converted into an
MultibandImageorMultibandMaskedImage(depending onimageType). This might be different than the internalmMaskedImageproperty of theMultibandFootprint, as themMaskedImagemight 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
MultibandMaskedImageorMultibandImageand describes the type of the output image.
Returns: - result :
MultibandBase The resulting
MultibandImageorMultibandMaskedImagecreated from theMultibandHeavyFootprint.
- bbox :
-
getPeaks()¶ Get the
PeakCatalog
-
getSpans()¶ Get the full
SpanSet
-
getXY0()¶ Minimum coordinate in the bounding box
-
setXY0(xy0)¶ Shift the bounding box but keep the same Extent
Parameters: - xy0: `Point2I`
New minimum bounds of the bounding box
-
shiftedBy(offset)¶ 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
-
shiftedTo(xy0)¶ 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.
- filters :