Gain estimation from flat-field ratios (source code)

= Gain estimation from flat-field ratios

Let independent exposure sums $A,B$ have mean $N$ <ADU> at each <detector pixel>, with pure <Poisson distribution> noise and fixed gain $g$. The <delta method> gives $A/B\simeq1+(A-N)/N-(B-N)/N$, so $\operatorname{Var}(A/B)\simeq2/(gN)$ and $g\simeq2/(NE^2)$. For nonuniform <detector pixel> means $N_i$, an unweighted spatial ratio <variance> is instead $(2/g)\langle1/N_i\rangle$. This high-count approximation requires linear unsaturated data, bias subtraction and negligible <read noise>.