lsst.afw gf03f0b42f3+b1047159b2
Loading...
Searching...
No Matches
lsst.afw.image._exposure._multiband.MultibandExposure Class Reference
Inheritance diagram for lsst.afw.image._exposure._multiband.MultibandExposure:
lsst.afw.image._image._multiband.MultibandTripleBase lsst.afw.multiband.MultibandBase

Public Member Functions

 __init__ (self, bands, image, mask, variance, psfs=None)
 
 computePsfKernelImage (self, position)
 
 computePsfImage (self, position=None)
 
 getPsfs (self)
 
 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)
 
 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

 fromExposures (bands, singles)
 
 fromArrays (bands, image, mask, variance, bbox=None)
 
 fromKwargs (bands, bandKwargs, singleType=ExposureF, **kwargs)
 
 fromButler (butler, bands, *args, **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

MultibandExposure class

This class acts as a container for multiple `afw.Exposure` objects.
All exposures must have the same bounding box, and the associated
images must all have the same data type.

See `MultibandTripleBase` for parameter definitions.

Definition at line 125 of file _multiband.py.

Constructor & Destructor Documentation

◆ __init__()

lsst.afw.image._exposure._multiband.MultibandExposure.__init__ ( self,
bands,
image,
mask,
variance,
psfs = None )

Definition at line 134 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.

◆ _buildSingles()

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

Parameters
----------
image: `list`
    List of `Image` objects that represent the image in each band.
mask: `list`
    List of `Mask` objects that represent the mask in each band.
variance: `list`
    List of `Image` objects 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 165 of file _multiband.py.

◆ _slice()

lsst.afw.image._exposure._multiband.MultibandExposure._slice ( self,
bands,
bandIndex,
indices )
protected
Slice the current object and return the result

See `Multiband._slice` for a list of the parameters.
This overwrites the base method to attach the PSF to
each individual exposure.

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

Definition at line 295 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 86 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.

◆ computePsfImage()

lsst.afw.image._exposure._multiband.MultibandExposure.computePsfImage ( self,
position = None )
Get a multiband PSF image

The PSF Kernel Image is computed for each band
and combined into a (band, y, x) array and stored
as `self._psfImage`.
The result is not cached, so if the same PSF is expected
to be used multiple times it is a good idea to store the
result in another variable.

Parameters
----------
position: `Point2D` or `tuple`
    Coordinates to evaluate the PSF. If `position` is `None`
    then `Psf.getAveragePosition()` is used.

Returns
-------
self._psfImage: array
    The multiband PSF image.

Definition at line 258 of file _multiband.py.

◆ computePsfKernelImage()

lsst.afw.image._exposure._multiband.MultibandExposure.computePsfKernelImage ( self,
position )
Get a multiband PSF image

The PSF Kernel Image is computed for each band
and combined into a (band, y, x) array and stored
as `self._psfImage`.
The result is not cached, so if the same PSF is expected
to be used multiple times it is a good idea to store the
result in another variable.

Parameters
----------
position: `Point2D` or `tuple`
    Coordinates to evaluate the PSF.

Returns
-------
self._psfImage: array
    The multiband PSF image.

Definition at line 232 of file _multiband.py.

◆ fromArrays()

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

see `tripleFromArrays` for a description of parameters

Definition at line 150 of file _multiband.py.

◆ fromButler()

lsst.afw.image._exposure._multiband.MultibandExposure.fromButler ( butler,
bands,
* args,
** kwargs )
static
Load a multiband exposure from a butler

Because each band is stored in a separate exposure file,
this method can be used to load all of the exposures for
a given set of bands

Parameters
----------
butler: `lsst.daf.butler.Butler`
    Butler connection to use to load the single band
    calibrated images
bands: `list` or `str`
    List of names for each band
args: `list`
    Arguments to the Butler.
kwargs: `dict`
    Keyword arguments to pass to the Butler
    that are the same in all bands.

Returns
-------
result: `MultibandExposure`
    The new `MultibandExposure` created by combining all of the
    single band exposures.

Definition at line 200 of file _multiband.py.

◆ fromExposures()

lsst.afw.image._exposure._multiband.MultibandExposure.fromExposures ( bands,
singles )
static
Construct a MultibandImage from a collection of single band images

see `tripleFromExposures` for a description of parameters

Definition at line 141 of file _multiband.py.

◆ fromKwargs()

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

see `makeTripleFromKwargs` for a description of parameters

Definition at line 158 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.

◆ getPsfs()

lsst.afw.image._exposure._multiband.MultibandExposure.getPsfs ( self)
Extract the PSF model in each band

Returns
-------
psfs : `dict` of `lsst.afw.detection.Psf`
    The PSF in each band

Definition at line 285 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.

◆ 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 124 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 262 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 92 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 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.

◆ _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 56 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 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: