AmplifierIsolator

class lsst.afw.cameraGeom.AmplifierIsolator(amplifier, parent_bbox, parent_detector)

Bases: object

A class that can extracts single-amplifier subimages from trimmed or untrimmed assembled images and transforms them to a particular orientation and offset.

Callers who have a in-memory assembled lsst.afw.image.Exposure should generally just use the apply class method. Other methods can be used to implement subimage loads of on on-disk images (e.g. formatter classes in obs_base) or obtain subsets from other image classes.

Parameters:
amplifierAmplifier

Amplifier object that identifies the amplifier to load and sets the orientation and offset of the returned subimage.

parent_bboxlsst.geom.Box2I

Bounding box of the assembled parent image. This must be equal to either parent_detector.getBBox() or parent_detector.getRawBBox(); which one is used to determine whether the parent image (and hence the amplifier subimages) is trimmed.

parent_detectorDetector

Detector object that describes the parent image.

Attributes Summary

subimage_bbox

The bounding box of the target amplifier in the parent image (lsst.geom.Box2I).

Methods Summary

apply(parent_exposure, amplifier)

Obtain a single-amplifier lsst.afw.image.Exposure subimage that masquerades as full-detector image for a single-amp detector.

make_detector()

Create a single-amplifier detector that describes the transformed subimage.

transform_subimage(subimage)

Transform an already-extracted subimage to match the orientation and offset of the target amplifier.

Attributes Documentation

subimage_bbox

The bounding box of the target amplifier in the parent image (lsst.geom.Box2I).

Methods Documentation

classmethod apply(parent_exposure, amplifier)

Obtain a single-amplifier lsst.afw.image.Exposure subimage that masquerades as full-detector image for a single-amp detector.

Parameters:
parent_exposurelsst.afw.image.Exposure

Parent image to obtain a subset from. getDetector must not return None.

amplifierAmplifier

Target amplifier for the subimage. May differ from the amplifier obtained by parent_exposure.getDetector()[amplifier.getName()] only by flips and differences in getRawXYOffset.

Returns:
subimagelsst.afw.image.Exposure

Exposure subimage for the target amplifier, with the orientation and XY0 described by that amplifier, and a single-amp detector holding a copy of that amplifier.

Notes

Because we use the target amplifier’s bounding box as the bounding box of the detector attached to the returned exposure, other exposure components that are passed through unmodified (e.g. the WCS) should still be valid for the single-amp exposure after it is trimmed and “assembled”. Unlike most trimmed+assembled images, however, it will have a nonzero XY0, and code that (incorrectly!) does not pay attention to XY0 may break.

make_detector()

Create a single-amplifier detector that describes the transformed subimage.

Returns:
detectorDetector

Detector object with a single amplifier, a trimmed bounding box equal to the amplifier’s trimmed bounding box, and no crosstalk.

transform_subimage(subimage)

Transform an already-extracted subimage to match the orientation and offset of the target amplifier.

Parameters:
subimageimage-like

The subimage to transform; may be any of lsst.afw.image.Image, lsst.afw.image.Mask, lsst.afw.image.MaskedImage, and lsst.afw.image.Exposure.

Returns:
transformedimage-like

Transformed image of the same type as subimage.