# What do the flags in the second extension of the CALEXP fits files mean?

**URL:** <https://www.rubin.community/t/what-do-the-flags-in-the-second-extension-of-the-calexp-fits-files-mean/5778>\
**Category:** Support\
**Created:** [August 9, 2021, 9:21pm UTC](https://www.rubin.community/t/what-do-the-flags-in-the-second-extension-of-the-calexp-fits-files-mean/5778 "2021-08-09T21:21:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![StephenGwyn](https://avatars.discourse-cdn.com/v4/letter/s/3d9bf3/32.png) [@StephenGwyn](https://www.rubin.community/u/StephenGwyn)\
**Post date:** [August 9, 2021, 9:21pm UTC](https://www.rubin.community/t/what-do-the-flags-in-the-second-extension-of-the-calexp-fits-files-mean/5778/1 "2021-08-09T21:21:36Z")

</div>

I’m processing HSC data. Looking at the output of the processccd.py stage, I see that the second extension of the CORR-0123456-041.fits files represents flags for each pixel. What is the meaning of each of the flags?

---

<div class="post-metadata">

**Author:** ![ktl](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/ktl/32/1373_2.png) [@ktl](https://www.rubin.community/u/ktl)\
**Post date:** [August 9, 2021, 10:22pm UTC](https://www.rubin.community/t/what-do-the-flags-in-the-second-extension-of-the-calexp-fits-files-mean/5778/2 "2021-08-09T22:22:23Z")

</div>

This is referred to in the Science Pipelines documentation as the “mask” plane.

[Getting started tutorial part 3: displaying exposures and source tables output by processCcd.py — LSST Science Pipelines](https://pipelines.lsst.io/getting-started/display.html#interpreting-displayed-mask-colors) has a way to retrieve the names of the bits (and the bit position, although that’s not printed in the code snippet). You can also see the bit numbers for each plane in the `MP_*` headers within the mask plane HDU in the FITS file.

[LSST Applications: How Mask Planes are handled in @c afw](http://doxygen.lsst.codes/stack/doxygen/x_masterDoxyDoc/afw_mask_planes.html) gives a bit more low-level information.

As to translating the mask names into what they actually mean, I’ll leave that for someone else.

---

<div class="post-metadata">

**Author:** ![StephenGwyn](https://avatars.discourse-cdn.com/v4/letter/s/3d9bf3/32.png) [@StephenGwyn](https://www.rubin.community/u/StephenGwyn)\
**Post date:** [August 10, 2021, 12:06am UTC](https://www.rubin.community/t/what-do-the-flags-in-the-second-extension-of-the-calexp-fits-files-mean/5778/3 "2021-08-10T00:06:02Z")

</div>

The second link is what I wanted, thanks!
