imutil.imstat.errormap

imutil.imstat.errormap(
    ccd_biassub,
    gain_epadu=1,
    rdnoise_electron=0,
    subtracted_dark=0.0,
    flat=1.0,
    dark_std=0.0,
    flat_err=0.0,
    dark_std_min='rdnoise',
    return_variance=False,
)

Propagate independent detector and calibration errors through a flat.

Parameters

ccd_biassub : ndarray or path - like

Bias-subtracted signal D in ADU, before flat division. If a dark was subtracted, D must be the dark-subtracted signal and subtracted_dark must contain the removed counts. For CCDData/HDU input, pass .data.

gain_epadu : float or Quantity = 1

Detector gain g in electrons per ADU.

rdnoise_electron : float or Quantity = 0

Science-exposure read noise R in electrons.

subtracted_dark : float or ndarray = 0.0

Removed dark counts in pre-flat ADU. Restores their science-exposure Poisson noise; this is distinct from dark-calibration uncertainty.

flat : float or ndarray = 1.0

Dimensionless divisor F. Use 1 for no flat division. An already flat-divided signal must first be multiplied by its original F.

dark_std : float or ndarray = 0.0

Independent uncertainty s_D of the subtracted dark calibration in pre-flat ADU, after any exposure scaling. Excludes science-exposure Poisson and read noise, which are included separately.

flat_err : float or ndarray = 0.0

Absolute uncertainty s_F of F. Zero treats the flat as exact but still propagates detector noise through division by F.

dark_std_min : float or str = 'rdnoise'

Floor applied to ndarray dark_std. "rdnoise" means R/g. Scalar dark_std is used as supplied, retaining the zero default when no dark-calibration uncertainty is requested.

return_variance : bool = False

Return variance in ADU squared instead of standard deviation in ADU.

Returns

: ndarray

Variance or standard deviation of D/F.

Notes

Assuming independent noise sources, the variance is

\[ V = \frac{\max(D + D_{dark}, 0)/g + s_D^2 + (R/g)^2}{F^2} + \left(\frac{D s_F}{F^2}\right)^2. \]

Only the estimated Poisson counts are clipped to zero; negative D still contributes to flat-calibration uncertainty. F must be nonzero.