gainContext

lsst.ip.isr.gainContext(exp, image, apply, gains=None, invert=False, isTrimmed=True)

Context manager that applies and removes gain.

Parameters:
explsst.afw.image.Exposure

Exposure to apply/remove gain.

imagelsst.afw.image.Image

Image to apply/remove gain.

applybool

If True, apply and remove the amplifier gain.

gainsdict [str, float], optional

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

invertbool, optional

Invert the gains (e.g. convert electrons to adu temporarily)?

isTrimmedbool, optional

Is this a trimmed exposure?

Yields:
explsst.afw.image.Exposure

Exposure with the gain applied.