Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 40 additions & 24 deletions DP1/200_Data_Products/202_Images/202_6_Pixel_mask_planes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -197,30 +197,30 @@
"id": "6e121256-0364-450a-a95c-985dc8f41875",
"metadata": {},
"source": [
"| Mask Plane | Visit Bit | Visit 2$^n$| Coadd Bit | Coadd 2$^n$ | Image Type | Description (DP1-specific) |\n",
"|:----------------------|:----------|:----------|:-----------|:-----------|:-------------|:------------------------------------|\n",
"| **BAD** | 0 | 1 | 0 | 1 | visit + coadd | Permanently bad pixels, including whole bad amplifiers. Excluded from science use. |\n",
"| **SAT** | 1 | 2 | 1 | 2 | visit + coadd | The flux in this pixel was too high to be accurately recorded (its value exceeded the Photon Transfer Curve (PTC) turnoff point). In coadds, it indicates that saturation affected at least part of the stack at this location. |\n",
"| **INTRP** | 2 | 4 | 2 | 4 | visit + coadd | Pixel’s value was replaced via interpolation (usually because it was flagged `BAD`, `SAT`, or `CR`). For coadds, the value was interpolated during stacking, or all inputs had this pixel interpolated. |\n",
"| **CR** | 3 | 8 | 3 | 8 | visit + coadd |Pixels hit by a cosmic ray; these pixels are interpolated. For coadds, one or more input visits flagged this pixel as a cosmic ray. |\n",
"| **EDGE** | 4 | 16 | 4 | 16 | visit + coadd | Region unprocessed due to convolution kernel footprint extending beyond the image edge. |\n",
"| **DETECTED** | 5 | 32 | 5 | 32 | visit + coadd | Pixel footprint belongs to a detected source above threshold. For coadds, the pixel was detected as part of a source footprint on the coadd itself. |\n",
"| **DETECTED_NEGATIVE** | 6 | 64 | 6 | 64 | difference | Negative source detection in difference images. |\n",
"| **SUSPECT** | 7 | 128 | 7 | 128 | visit + coadd | Pixel above the PTC turnoff but not fully saturated. Not dilated like `SAT`. Propagates to coadd if a configurable fraction of input visits flagged it as `SUSPECT`. |\n",
"| **NO_DATA** | 8 | 256 | 8 | 256 | visit + coadd | No valid data (chip gap, missing coverage, or failed amplifier). |\n",
"| **VIGNETTED** | 9 | 512 | 9 | 512 | visit + coadd | Pixels vignetted by optics; low-weight or low-quality data. For coadds, the pixel lies in a vignetted region in all contributing visits. |\n",
"| **STREAK** | 10 | 1024 | 10 | 1024 | difference | Linear artifact (e.g., satellite trail or diffraction spike). |\n",
"| **CLIPPED** | 11 | 2048 | 11 | 2048 | coadd only | At least one input image for this pixel was identified as an artifact and excluded. |\n",
"| **CROSSTALK** | 12 | 4096 | 12 | 4096 | visit + coadd | Pixel affected by electronic crosstalk from a bright source in another amplifier. For coadds, one or more inputs flagged this pixel as affected by crosstalk. |\n",
"| **INEXACT_PSF** | 13 | 8192 | 13 | 8192 | coadd only | The PSF at this pixel is ill-defined or varies significantly across inputs. When set, this flag is accompanied by at least one of `SENSOR_EDGE`, `CLIPPED`, or `REJECTED`. |\n",
"| **ITL_DIP** | 16 | 65536 | 14 | 16384 | visit + coadd | “ITL dip” artifact: dark vertical trails from bright sources on ITL CCDs. For coadds, one or more input images flagged this pixel as affected. |\n",
"| **NOT_DEBLENDED** | 17 | 131072 | 15 | 32768 | visit + coadd | Pixel in a source footprint that was not deblended. |\n",
"| **REJECTED** | 18 | 262144 | 16 | 65536 | coadd only | Pixel where a contributing image was masked and not used. |\n",
"| **SENSOR_EDGE** | 20 | 1048576 | 17 | 131072 | coadd only | Pixel lies within a margin near the edge of at least one contributing input image. |\n",
"| **UNMASKEDNAN** | 21 | 2097152 | 18 | 262144 | visit + coadd | Pixel contains NaN without other mask; indicates invalid data. |\n",
"| **INJECTED** | 14 | 16384 | — | — | visit only | Pixels with synthetic sources injected for testing or validation. |\n",
"| **INJECTED_TEMPLATE** | 15 | 32768 | — | — | difference | Pixels with synthetic sources injected into template images (for difference image analysis). |\n",
"| **SAT_TEMPLATE** | 19 | 524288 | — | — | difference | Pixel saturated in the template image used for difference imaging. |\n"
"| Mask Plane | Image Type | Description (DP1-specific) |\n",
"|----------------------|------------------|-----------------------------|\n",
"| **BAD** | visit + coadd | Permanently bad pixels, including entire bad amplifiers. Excluded from science use. |\n",
"| **SAT** | visit + coadd | The flux in this pixel was too high to be accurately recorded (exceeded the PTC turnoff point). In coadds, indicates saturation in at least part of the stack at this location. |\n",
"| **INTRP** | visit + coadd | Pixel value was replaced via interpolation (typically due to `BAD`, `SAT`, or `CR`). For coadds, all inputs had this pixel interpolated or it was interpolated during stacking. |\n",
"| **CR** | visit + coadd | Pixels hit by a cosmic ray; interpolated in visits. In coadds, one or more input visits flagged this pixel as a cosmic ray. |\n",
"| **EDGE** | visit + coadd | Region unprocessed where the convolution kernel footprint extended beyond the image edge. |\n",
"| **DETECTED** | visit + coadd | Pixel footprint belongs to a detected source above threshold. In coadds, detection occurred on the coadd. |\n",
"| **DETECTED_NEGATIVE** | difference | Negative source detection in difference images. |\n",
"| **SUSPECT** | visit + coadd | Pixel above the PTC turnoff but not fully saturated; not dilated like `SAT`. Propagates if a configurable fraction of inputs flagged it. |\n",
"| **NO_DATA** | visit + coadd | No valid data (chip gap, missing coverage, or failed amplifier). |\n",
"| **VIGNETTED** | visit + coadd | Pixels vignetted by optics; low-weight or low-quality data. In coadds, vignetted in all contributing visits. |\n",
"| **STREAK** | difference | Linear artifact such as a satellite trail or diffraction spike. |\n",
"| **CLIPPED** | coadd only | At least one input image for this pixel was identified as an artifact and excluded. |\n",
"| **CROSSTALK** | visit + coadd | Pixel affected by electronic crosstalk from a bright source in another amplifier. In coadds, flagged in at least one input. |\n",
"| **INEXACT_PSF** | coadd only | PSF poorly defined or inconsistent across inputs. Appears with at least one of `SENSOR_EDGE`, `CLIPPED`, or `REJECTED`. |\n",
"| **ITL_DIP** | visit + coadd | “ITL dip” artifact: dark vertical trails from bright sources on ITL CCDs. For coadds, flagged in at least one input. |\n",
"| **NOT_DEBLENDED** | visit + coadd | Pixel in a source footprint that was not successfully deblended. |\n",
"| **REJECTED** | coadd only | Pixel where a contributing image was masked and not used. |\n",
"| **SENSOR_EDGE** | coadd only | Pixel lies within a margin near the edge of at least one contributing input image. |\n",
"| **UNMASKEDNAN** | visit + coadd | Pixel contains a NaN without an accompanying mask flag; indicates invalid data. |\n",
"| **INJECTED** | visit only | Pixels with synthetic sources injected for testing or validation. |\n",
"| **INJECTED_TEMPLATE** | difference | Pixels with synthetic sources injected into template images for difference imaging tests. |\n",
"| **SAT_TEMPLATE** | difference | Pixel saturated in the template image used for difference imaging. |\n"
]
},
{
Expand Down Expand Up @@ -497,6 +497,14 @@
"mask.interpret(value)"
]
},
{
"cell_type": "markdown",
"id": "c9c14200-1c18-4f03-91ad-bfa11c6704c4",
"metadata": {},
"source": [
"> **Warning:** Bit values are assigned dynamically and are not guaranteed to be fixed."
]
},
{
"cell_type": "markdown",
"id": "103101ef-5d9b-4b53-b445-8a524cc870fb",
Expand Down Expand Up @@ -902,6 +910,14 @@
"Print a list of the unique mask array values, the number of pixels with that value, and the overlapping masks for pixels with that value."
]
},
{
"cell_type": "markdown",
"id": "08b5bb9a-8b4f-4546-b2a5-f8cfecf1a4d7",
"metadata": {},
"source": [
"> **Warning:** Bit values are assigned dynamically and are not guaranteed to be fixed. "
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down