e2ADU - EranOfek/AstroPack GitHub Wiki
Description
The function allows to convert ULTRASAT counts (electrons) into 14-bit ADU codes with an account of the dual gain. The output is a matrix of ADUs.
Example
% if the signal is above the threshold, use low gain
ImageSrcNoiseGainMask = ImageSrcNoise > GainThresh;
ImageSrcNoiseGain = ImageSrcNoise .* ( ImageSrcNoiseGainMask .* E2ADUlow + (ones(ImageSizeX,ImageSizeY)-ImageSrcNoiseGainMask) .* E2ADUhigh );
% the output ADU is a 14-bit integer
ImageSrcNoiseADU = ultrasat.e2ADU(ImageSrcNoiseGain, ImageSrcNoiseGainMask);