This page details the meaning of the bitmasks provided with Data Release 8 of the Legacy Surveys. The bits are enumerated as a power (i.e. 7 written in a column of bits means two-to-the-power-of-7).
See also the legacypipe bitmask definitions. Note that the difference between bits 0, 1, 2, 3 for BRIGHTBLOB as compared to bits 1, 11, 12 and 13 for MASKBITS is that BRIGHTBLOB is set based on an initial position (the source detection integer pixel peak), while MASKBITS is set after fitting has finished (i.e., on the final brick pixel position). This can lead to slight differences (~0.15%) in the areas covered by the MASKBITS and BRIGHTBLOB masks.
|0||BRIGHT||source lies in the pixels that define a bright star (Tycho)|
|1||MEDIUM||source lies in the pixels that define medium bright star (GAIA)|
|2||CLUSTER||source lies in the pixels that define a globular cluster|
|3||GALAXY||source lies in the pixels that define an LSLGA large galaxy|
These definitions apply to both the values in the coadd/*/*/*maskbits* files and to MASKBITS columns in the Tractor and sweeps catalogs. See also the legacypipe bitmask definitions.
|0||NPRIMARY||touches a pixel that is outside the PRIMARY region of a brick|
|1||BRIGHT||touches a pixel in a blob containing a bright (Tycho-2) star|
|2||SATUR_G||touches a pixel that was saturated in at least one \(g\)-band image|
|3||SATUR_R||touches a pixel that was saturated in at least one \(r\)-band image|
|4||SATUR_Z||touches a pixel that was saturated in at least one \(z\)-band image|
|5||ALLMASK_G||touches a pixel that has any of the ALLMASK_G bits set|
|6||ALLMASK_R||touches a pixel that has any of the ALLMASK_R bits set|
|7||ALLMASK_Z||touches a pixel that has any of the ALLMASK_Z bits set|
|8||WISEM1||touches a pixel in a WISEMASK_W1 bright star mask|
|9||WISEM2||touches a pixel in a WISEMASK_W2 bright star mask|
|10||BAILOUT||touches a pixel in a blob where we "bailed out" of source fitting|
|11||MEDIUM||touches a pixel in a medium-bright (Gaia DR2) star|
|12||GALAXY||touches a pixel in an LSLGA large galaxy|
|13||CLUSTER||touches a pixel in a globular cluster|
ANYMASK_X denotes a source that touches a bad pixel in any of a set of overlapping \(X\)-band images whereas ALLMASK_X denotes a source that touches a bad pixel in all of a set of overlapping \(X\)-band images. See, also, the legacypipe bitmask definitions. The ANYMASK and ALLMASK bit masks are defined as follows, mostly from the CP (NOAO Community Pipeline) Data Quality bits.
|0||BADPIX||bad columns, hot pixels, etc. (see the CP Data Quality bit description)|
|1||SATUR||saturated (see the CP Data Quality bit description)|
|2||INTERP||interpolated (see the CP Data Quality bit description)|
|4||CR||single exposure cosmic ray (see the CP Data Quality bit description)|
|6||BLEED||bleed trail (see the CP Data Quality bit description)|
|7||TRANS||multi-exposure transient (see the CP Data Quality bit description)|
|8||EDGE||edge pixel (see the CP Data Quality bit description)|
|9||EDGE2||edge pixel (see the CP Data Quality bit description)|
|11||OUTLIER||marked as touching an outlier pixel by legacypipe itself|
WISEMASK_W1 and WISEMASK_W2 have identical bit definitions, the only difference is that WISEMASK_W1 applies to masking in the W1 band and WISEMASK_W2 to masking in the W2 band.
|0||BRIGHT||Bright star core and wings|
|1||SPIKE||PSF-based diffraction spike|
|4||LATENT2||Second latent image|
|5||HALO||AllWISE-like circular halo|
|6||SATUR||Bright star saturation|
|7||SPIKE2||Geometric diffraction spike|
Aaron Meisner's unWISE documentation details how these masks were derived.