trimToMatchCalibBBox

lsst.ip.isr.trimToMatchCalibBBox(rawMaskedImage, calibMaskedImage)

Compute number of edge trim pixels to match the calibration data.

Use the dimension difference between the raw exposure and the calibration exposure to compute the edge trim pixels. This trim is applied symmetrically, with the same number of pixels masked on each side.

Parameters:
rawMaskedImagelsst.afw.image.MaskedImage

Image to trim.

calibMaskedImagelsst.afw.image.MaskedImage

Calibration image to draw new bounding box from.

Returns:
replacementMaskedImagelsst.afw.image.MaskedImage

rawMaskedImage trimmed to the appropriate size.

Raises:
RuntimeError

Raised if rawMaskedImage cannot be symmetrically trimmed to match calibMaskedImage.