H Quality flags

The Surf software conforms to the NDF standard concerning the processing of quality or bad-pixel masks. Each method of setting a pixel bad is associated with a bit in the quality masking flag (the NDF.QUALITY.BADBITS component). The bad bits and their meaning in Surf are described in table 4.


Table 4: Quality bits used by Surf






Bit# Value Meaning



0 1 Infinity (eg division by zero)
1 2 Set by flatfield.
2 4 Set by reduce_switch if the transputers detected more spikes
than specified by the SPIKE_LEVEL parameter.
3 8 Set by change_quality.
4 16 Set by despiking (scuclip and despike)







In order to remove the effect of a particular bit (i.e. to ignore a despiking), the Kappa task setbb can be used to change the bad-bits mask in the NDF. Simply calculate the value related to the bits you are interested in keeping and use this value in setbb. Note that care must be taken in deciding which bits are to be used for masking bad data. Bits zero and one must always be set whereas the other three bits are optional. change_quality is the only task that acts on a file rather than producing a processed copy and it is probably better if change_quality is used directly if you wish to manipulate the mask associated with bit three.

Additionally, regridded images also use quality flags. Bit 0 is used to represent areas where no data were available and bit 1 is used to mask data at the edge of the regridded area via the TRIM parameter.