Skip to content

Commit 4afd480

Browse files
authored
Merge pull request #102 from lsst/tickets/SP-2625-2025DEC11
SP-2625-2025DEC11: NB 200 the image mask plane (cont).
2 parents 556f0e3 + 1c38d75 commit 4afd480

1 file changed

Lines changed: 40 additions & 24 deletions

File tree

DP1/200_Data_Products/202_Images/202_6_Pixel_mask_planes.ipynb

Lines changed: 40 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -197,30 +197,30 @@
197197
"id": "6e121256-0364-450a-a95c-985dc8f41875",
198198
"metadata": {},
199199
"source": [
200-
"| Mask Plane | Visit Bit | Visit 2$^n$| Coadd Bit | Coadd 2$^n$ | Image Type | Description (DP1-specific) |\n",
201-
"|:----------------------|:----------|:----------|:-----------|:-----------|:-------------|:------------------------------------|\n",
202-
"| **BAD** | 0 | 1 | 0 | 1 | visit + coadd | Permanently bad pixels, including whole bad amplifiers. Excluded from science use. |\n",
203-
"| **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",
204-
"| **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",
205-
"| **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",
206-
"| **EDGE** | 4 | 16 | 4 | 16 | visit + coadd | Region unprocessed due to convolution kernel footprint extending beyond the image edge. |\n",
207-
"| **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",
208-
"| **DETECTED_NEGATIVE** | 6 | 64 | 6 | 64 | difference | Negative source detection in difference images. |\n",
209-
"| **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",
210-
"| **NO_DATA** | 8 | 256 | 8 | 256 | visit + coadd | No valid data (chip gap, missing coverage, or failed amplifier). |\n",
211-
"| **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",
212-
"| **STREAK** | 10 | 1024 | 10 | 1024 | difference | Linear artifact (e.g., satellite trail or diffraction spike). |\n",
213-
"| **CLIPPED** | 11 | 2048 | 11 | 2048 | coadd only | At least one input image for this pixel was identified as an artifact and excluded. |\n",
214-
"| **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",
215-
"| **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",
216-
"| **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",
217-
"| **NOT_DEBLENDED** | 17 | 131072 | 15 | 32768 | visit + coadd | Pixel in a source footprint that was not deblended. |\n",
218-
"| **REJECTED** | 18 | 262144 | 16 | 65536 | coadd only | Pixel where a contributing image was masked and not used. |\n",
219-
"| **SENSOR_EDGE** | 20 | 1048576 | 17 | 131072 | coadd only | Pixel lies within a margin near the edge of at least one contributing input image. |\n",
220-
"| **UNMASKEDNAN** | 21 | 2097152 | 18 | 262144 | visit + coadd | Pixel contains NaN without other mask; indicates invalid data. |\n",
221-
"| **INJECTED** | 14 | 16384 | — | — | visit only | Pixels with synthetic sources injected for testing or validation. |\n",
222-
"| **INJECTED_TEMPLATE** | 15 | 32768 | — | — | difference | Pixels with synthetic sources injected into template images (for difference image analysis). |\n",
223-
"| **SAT_TEMPLATE** | 19 | 524288 | — | — | difference | Pixel saturated in the template image used for difference imaging. |\n"
200+
"| Mask Plane | Image Type | Description (DP1-specific) |\n",
201+
"|----------------------|------------------|-----------------------------|\n",
202+
"| **BAD** | visit + coadd | Permanently bad pixels, including entire bad amplifiers. Excluded from science use. |\n",
203+
"| **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",
204+
"| **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",
205+
"| **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",
206+
"| **EDGE** | visit + coadd | Region unprocessed where the convolution kernel footprint extended beyond the image edge. |\n",
207+
"| **DETECTED** | visit + coadd | Pixel footprint belongs to a detected source above threshold. In coadds, detection occurred on the coadd. |\n",
208+
"| **DETECTED_NEGATIVE** | difference | Negative source detection in difference images. |\n",
209+
"| **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",
210+
"| **NO_DATA** | visit + coadd | No valid data (chip gap, missing coverage, or failed amplifier). |\n",
211+
"| **VIGNETTED** | visit + coadd | Pixels vignetted by optics; low-weight or low-quality data. In coadds, vignetted in all contributing visits. |\n",
212+
"| **STREAK** | difference | Linear artifact such as a satellite trail or diffraction spike. |\n",
213+
"| **CLIPPED** | coadd only | At least one input image for this pixel was identified as an artifact and excluded. |\n",
214+
"| **CROSSTALK** | visit + coadd | Pixel affected by electronic crosstalk from a bright source in another amplifier. In coadds, flagged in at least one input. |\n",
215+
"| **INEXACT_PSF** | coadd only | PSF poorly defined or inconsistent across inputs. Appears with at least one of `SENSOR_EDGE`, `CLIPPED`, or `REJECTED`. |\n",
216+
"| **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",
217+
"| **NOT_DEBLENDED** | visit + coadd | Pixel in a source footprint that was not successfully deblended. |\n",
218+
"| **REJECTED** | coadd only | Pixel where a contributing image was masked and not used. |\n",
219+
"| **SENSOR_EDGE** | coadd only | Pixel lies within a margin near the edge of at least one contributing input image. |\n",
220+
"| **UNMASKEDNAN** | visit + coadd | Pixel contains a NaN without an accompanying mask flag; indicates invalid data. |\n",
221+
"| **INJECTED** | visit only | Pixels with synthetic sources injected for testing or validation. |\n",
222+
"| **INJECTED_TEMPLATE** | difference | Pixels with synthetic sources injected into template images for difference imaging tests. |\n",
223+
"| **SAT_TEMPLATE** | difference | Pixel saturated in the template image used for difference imaging. |\n"
224224
]
225225
},
226226
{
@@ -497,6 +497,14 @@
497497
"mask.interpret(value)"
498498
]
499499
},
500+
{
501+
"cell_type": "markdown",
502+
"id": "c9c14200-1c18-4f03-91ad-bfa11c6704c4",
503+
"metadata": {},
504+
"source": [
505+
"> **Warning:** Bit values are assigned dynamically and are not guaranteed to be fixed."
506+
]
507+
},
500508
{
501509
"cell_type": "markdown",
502510
"id": "103101ef-5d9b-4b53-b445-8a524cc870fb",
@@ -902,6 +910,14 @@
902910
"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."
903911
]
904912
},
913+
{
914+
"cell_type": "markdown",
915+
"id": "08b5bb9a-8b4f-4546-b2a5-f8cfecf1a4d7",
916+
"metadata": {},
917+
"source": [
918+
"> **Warning:** Bit values are assigned dynamically and are not guaranteed to be fixed. "
919+
]
920+
},
905921
{
906922
"cell_type": "code",
907923
"execution_count": null,

0 commit comments

Comments
 (0)