TSCALE
, that's specified in the header.
OBJMASK
s in the MASK_SATUR
mask. Because a saturated pixel may have bled into its neighbour above
or below it, but the resulting pixel value may be below threshold, an
additional pixel at above and below each saturated column is added to
this mask. In addition, if extra_bad_satur_columns
is
specified in the fpParam.par
file (default: 1), pixels
just to the left and right of the saturated OBJMASK
are treated as saturated; they appear to be contaminated by charge transfer
problems in the serial register.
There are also effects that look like bias variations due to bright stars generating charge as they cross the serial register, which is as light-sensitive as any other part of the detector and is not masked on our CCDs. To remove these, we monitor the median value of the overclock and bias (extended register) pixels. While doing this, we note that the extended register was pixels were read before the data region, so the value from the previous row should be used. If the correction is greater than half a DN we linearily interpolate between the value from the left and the right of the chip (or to the centre for two-amplifier chips) and subtract the result.
Each pixel that is not saturated is then bias subtracted (allowing for bias drifts) and divided by the flat field (or, more precisely, multiplied by the inverse flat field). The soft_bias is then added back to keep all pixel values positive.
Because of the way that the flat field is normalised, a low-sensitivity pixel
that isn't saturated in the raw frame can have a value too large to fit
into 16 bits after flatfielding. If this is the case, the nominal
saturation_level
for the frame is lowered. Unless something
nasty has happened (e.g. the bias drift is wildly wrong) the adopted
saturation level should still be close to 65000.
The final stage is to interpolate over all bad pixels, including those labelled as saturated. The algorithm used is described elsewhere. In deriving the interpolation coefficients we assume that the signal-to-noise is infinite, and that the PSF is a sigma=1pixel Gaussian (i.e. ~ 1" FWHM). The correction code is machine generated, to it wouldn't be too hard to relax these restrictions if it proved necessary.
All interpolated pixels are added to the MASK_INTERP
mask.
Interpolation is only carried out using good pixels from the same row; it would be better to use a region with larger support, but the book-keeping involved was too frightening to contemplate (remember; we have to handle bleed trails as well as intrinsic bad columns, and they can easily be adjacent or separated by a single column or row).
No provision is made for non-linearity of the CCDs. XXX
regStatsFromQuartiles
is used to determine the global sky level (and its standard deviation).
These values should come from PSP, but there seem to be problems. XXX