gainContext

lsst.ip.isr.gainContext(exp, image, apply, gains=None)

Context manager that applies and removes gain.

Parameters:
exp : lsst.afw.image.Exposure

Exposure to apply/remove gain.

image : lsst.afw.image.Image

Image to apply/remove gain.

apply : Bool

If True, apply and remove the amplifier gain.

gains : dict [str, float]

A dictionary, keyed by amplifier name, of the gains to use. If gains is None, the nominal gains in the amplifier object are used.

Yields:
exp : lsst.afw.image.Exposure

Exposure with the gain applied.