CCDPACK allows you to flag data values above a given limit as saturated. It performs this task using one of two methods, either setting the pixels BAD (often referred to as invalidating or setting to a magic value), in which case the future processing is transparent if applications which can accommodate BAD values are used, or alternatively by setting all such pixels to a defined value (this option may be necessary if the destination analysis programs cannot handle BAD values). In this latter case care is required because future operations to the data can easily modify the values, so that unintentional differentiation of the saturated data may occur. This will only happen in such situations as flatfielding where the pixels are modified singly, global operations such as subtraction, multiplication etc. by a constant will preserve the saturated value dataset, although modifying the actual saturation value.
If you process saturated data using a specified value within CCDPACK then a CCDPACK extension item is created and the saturation value is written to it. Future work within CCDPACK will then stop modification of these saturated values (the routines CALCOR and FLATCOR do this). In general if you can safely use BAD values this is by far the better option. If you are determined to mark saturated data using a specific value then it is recommended that calibration (dark, flash and flat) frames are processed using BAD values as the combination processes do not support saturated value preservation. If the resultant master calibration frames contain BAD values then replacement (by the value 1 or by the mean) of these can be performed in KAPPA (SUN/95: SETMAGIC).
CCDPACK