In deriving the 1-D flag spectrum, the cross-dispersion profile
and the flag values in the low-dispersion SF are examined. For each
wavelength sample the contribution to the spectral profile from
unflagged pixels is calculated. If this contribution amounts to at least
45% of the total flux (as represented by the associated profile
values), the wavelength sample will contain no flags in the output
spectrum. If less than 45% of the total flux in the profile is from
unflagged pixels, then each flag value is examined individually to
determine what fraction of the total contribution from all pixels is due
to one particular flag condition. For each flag condition that affects
pixels representing more than 15% of the spectral profile, that flag
value will appear in the output flag spectrum.
Situations can exist in which the contribution by pixels with one particular flag condition account for 45% of the flux at a given wavelength, for example, and a second flag condition is associated with pixels that account for only 11%. Here the total contribution from flagged pixels exceeds the 55% threshold, but only the flag value corresponding to the first condition will appear in the output flag spectrum. The threshold values were determined empirically so that problem conditions that definitely have an adverse affect on the computation of extracted fluxes are always flagged in the output spectrum, while, at the same time, conditions that only have a marginal impact are not flagged. Note that in marginal cases where only one or perhaps a few pixels that contribute in a relatively minor way to the total flux at a given wavelength are flagged and hence excluded from the computation of the extracted flux, the associated error estimate for that extracted flux value will be increased accordingly even though no flags will appear in the output spectrum. Thus the sigma spectrum serves as an additional indicator of the relative accuracy of the extracted fluxes.