lsst.afw g714e0ed6de+196fb0684f
Loading...
Searching...
No Matches
lsst.afw.image._image._multiband.MultibandMaskedImage Class Reference
Inheritance diagram for lsst.afw.image._image._multiband.MultibandMaskedImage:
lsst.afw.image._image._multiband.MultibandTripleBase lsst.afw.multiband.MultibandBase

Public Member Functions

 __init__ (self, bands, image=None, mask=None, variance=None)
 
 setXY0 (self, xy0)
 
 shiftedTo (self, xy0)
 
 clone (self, deep=True)
 
 image (self)
 
 mask (self)
 
 variance (self)
 
 getBBox (self, origin=PARENT)
 
 y0 (self)
 
 x0 (self)
 
 bands (self)
 
 singles (self)
 
 filters (self)
 
 getXY0 (self)
 
 origin (self)
 
 width (self)
 
 height (self)
 
 __len__ (self)
 
 __getitem__ (self, args)
 
 __iter__ (self)
 
 __next__ (self)
 
 shiftedBy (self, offset)
 
 __repr__ (self)
 
 __str__ (self)
 

Static Public Member Functions

 fromImages (bands, singles)
 
 fromArrays (bands, image, mask, variance, bbox=None)
 
 fromKwargs (bands, bandKwargs, singleType=MaskedImageF, **kwargs)
 

Public Attributes

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

Protected Member Functions

 _buildSingles (self, image=None, mask=None, variance=None)
 
 _slice (self, bands, bandIndex, indices)
 
 _verifyUpdate (self, image=None, mask=None, variance=None)
 
 _bandNamesToIndex (self, bandIndex)
 

Protected Attributes

 _image = image
 
 _mask = mask
 
 _variance = variance
 
 _bands = tuple([f for f in bands])
 
 _singles = tuple(singles)
 
 _bbox = self._singles[0].getBBox()
 
int _bandIndex = 0
 

Detailed Description

MultibandMaskedImage class

This class acts as a container for multiple `afw.MaskedImage` objects.
All masked images must have the same bounding box, and the associated
images must all have the same data type.
The `image`, `mask`, and `variance` are all stored separately into
a `MultibandImage`, `MultibandMask`, and `MultibandImage` respectively,
which each have their own internal 3D arrays (band, y, x).

See `MultibandTripleBase` for parameter definitions.

Definition at line 801 of file _multiband.py.

Constructor & Destructor Documentation

◆ __init__()

lsst.afw.image._image._multiband.MultibandMaskedImage.__init__ ( self,
bands,
image = None,
mask = None,
variance = None )

Definition at line 813 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 159 of file multiband.py.

◆ __iter__()

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

Definition at line 184 of file multiband.py.

◆ __len__()

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

Definition at line 156 of file multiband.py.

◆ __next__()

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

Definition at line 188 of file multiband.py.

◆ __repr__()

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

Definition at line 322 of file multiband.py.

◆ __str__()

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

Definition at line 327 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 196 of file multiband.py.

◆ _buildSingles()

lsst.afw.image._image._multiband.MultibandMaskedImage._buildSingles ( self,
image = None,
mask = None,
variance = None )
protected
Make a new list of single band objects

Parameters
----------
image : `MultibandImage`
   `MultibandImage` object that represent the image in each band.
mask : `MultibandMask`
   `MultibandMask` object that represent the mask in each band.
variance : `MultibandImage`
   `MultibandImage` object that represent the variance in each band.

Returns
-------
singles : `tuple`
   Tuple of `MaskedImage` objects for each band,
   where the `image`, `mask`, and `variance` of each `single`
   point to the multiband objects.

Definition at line 840 of file _multiband.py.

◆ _slice()

lsst.afw.image._image._multiband.MultibandTripleBase._slice ( self,
bands,
bandIndex,
indices )
protectedinherited
Slice the current object and return the result

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

Reimplemented from lsst.afw.multiband.MultibandBase.

Reimplemented in lsst.afw.image._exposure._multiband.MultibandExposure.

Definition at line 653 of file _multiband.py.

◆ _verifyUpdate()

lsst.afw.image._image._multiband.MultibandTripleBase._verifyUpdate ( self,
image = None,
mask = None,
variance = None )
protectedinherited
Check that the new image, mask, or variance is valid

This basically means checking that the update to the
property matches the current bounding box and inherits
from the `MultibandBase` class.

Definition at line 680 of file _multiband.py.

◆ bands()

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

Definition at line 98 of file multiband.py.

◆ clone()

lsst.afw.image._image._multiband.MultibandTripleBase.clone ( self,
deep = True )
inherited
Make a copy of the current instance

Reimplemented from lsst.afw.multiband.MultibandBase.

Definition at line 639 of file _multiband.py.

◆ filters()

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

Use `bands` instead.

Definition at line 90 of file multiband.py.

◆ fromArrays()

lsst.afw.image._image._multiband.MultibandMaskedImage.fromArrays ( bands,
image,
mask,
variance,
bbox = None )
static
Construct a MultibandMaskedImage from a collection of arrays

see `tripleFromArrays` for a description of parameters

Definition at line 825 of file _multiband.py.

◆ fromImages()

lsst.afw.image._image._multiband.MultibandMaskedImage.fromImages ( bands,
singles )
static
Construct a MultibandImage from a collection of single band images

see `tripleFromImages` for a description of parameters

Definition at line 817 of file _multiband.py.

◆ fromKwargs()

lsst.afw.image._image._multiband.MultibandMaskedImage.fromKwargs ( bands,
bandKwargs,
singleType = MaskedImageF,
** kwargs )
static
Build a MultibandImage from a set of keyword arguments

see `makeTripleFromKwargs` for a description of parameters

Definition at line 833 of file _multiband.py.

◆ getBBox()

lsst.afw.image._image._multiband.MultibandTripleBase.getBBox ( self,
origin = PARENT )
inherited
Bounding box

Reimplemented from lsst.afw.multiband.MultibandBase.

Definition at line 710 of file _multiband.py.

◆ getXY0()

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

Definition at line 114 of file multiband.py.

◆ height()

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

Definition at line 151 of file multiband.py.

◆ image()

lsst.afw.image._image._multiband.MultibandTripleBase.image ( self)
inherited
The image of the MultibandMaskedImage

Definition at line 696 of file _multiband.py.

◆ mask()

lsst.afw.image._image._multiband.MultibandTripleBase.mask ( self)
inherited
The mask of the MultibandMaskedImage

Definition at line 701 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 136 of file multiband.py.

◆ setXY0()

lsst.afw.image._image._multiband.MultibandTripleBase.setXY0 ( self,
xy0 )
inherited
Shift the bounding box but keep the same Extent
This is different than `MultibandBase.setXY0`
because the multiband `image`, `mask`, and `variance` objects
must all have their bounding boxes updated.
Parameters
----------
xy0 : `Point2I`
   New minimum bounds of the bounding box

Reimplemented from lsst.afw.multiband.MultibandBase.

Definition at line 595 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 274 of file multiband.py.

◆ shiftedTo()

lsst.afw.image._image._multiband.MultibandTripleBase.shiftedTo ( self,
xy0 )
inherited
Shift the bounding box but keep the same Extent

This is different than `MultibandBase.shiftedTo`
because the multiband `image`, `mask`, and `variance` objects
must all have their bounding boxes updated.

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

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

Reimplemented from lsst.afw.multiband.MultibandBase.

Definition at line 612 of file _multiband.py.

◆ singles()

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

Definition at line 104 of file multiband.py.

◆ variance()

lsst.afw.image._image._multiband.MultibandTripleBase.variance ( self)
inherited
The variance of the MultibandMaskedImage

Definition at line 706 of file _multiband.py.

◆ width()

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

Definition at line 145 of file multiband.py.

◆ x0()

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

X component of XY0 `Point2I.getX()`

Definition at line 120 of file multiband.py.

◆ y0()

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

Y component of XY0 `Point2I.getY()`

Definition at line 128 of file multiband.py.

Member Data Documentation

◆ _bandIndex

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

Definition at line 185 of file multiband.py.

◆ _bands

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

Definition at line 57 of file multiband.py.

◆ _bbox

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

Definition at line 61 of file multiband.py.

◆ _image

lsst.afw.image._image._multiband.MultibandTripleBase._image = image
protectedinherited

Definition at line 588 of file _multiband.py.

◆ _mask

lsst.afw.image._image._multiband.MultibandTripleBase._mask = mask
protectedinherited

Definition at line 589 of file _multiband.py.

◆ _singles

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

Definition at line 58 of file multiband.py.

◆ _variance

lsst.afw.image._image._multiband.MultibandTripleBase._variance = variance
protectedinherited

Definition at line 590 of file _multiband.py.

◆ array

lsst.afw.multiband.MultibandBase.array
inherited

Definition at line 329 of file multiband.py.

◆ bands

lsst.afw.multiband.MultibandBase.bands
inherited

Definition at line 157 of file multiband.py.

◆ singles

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

Definition at line 249 of file multiband.py.

◆ x0

lsst.afw.multiband.MultibandBase.x0
inherited

Definition at line 142 of file multiband.py.

◆ y0

lsst.afw.multiband.MultibandBase.y0
inherited

Definition at line 142 of file multiband.py.


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