Skip to content
Merged
Show file tree
Hide file tree
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
24 changes: 7 additions & 17 deletions config/calibration/mask_v2.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# mask columns MASK_<bit>_<label>, where True means MASKED. They are therefore
# cut with `kind: equal, value: False` (keep the un-masked objects):
#
# Reason bits of the ShapePipe r-band default bitmask:
# ShapePipe mask reason bits:
#
# MASK_1_Faint_star_halos faint star halos (bit 0; value 1)
# MASK_2_Bright_star_halos bright star halos (bit 1; value 2)
Expand All @@ -19,12 +19,11 @@
# u, g, r, i, HSC z-band coverage
# MASK_2048_z2 no Pan-STARRS z-band (z2) coverage
#
# The default selection (see sp_validation.galaxy.DEFAULT_MASK_COLUMNS) is
# bits 1 + 2 + 4 + 8 + 64 + 1024, whose OR matches mask_r, the r-band
# mask, on covered granules (verified on the P3 sky area); footprint-edge
# granules without mask_r coverage can differ. The other coverage flags and bit 2048 are listed
# here but commented out, since ORing all of them masks essentially
# everything.
# The default external-mask cut (see sp_validation.galaxy.DEFAULT_MASK_COLUMNS)
# uses bits 4 + 8 + 64 + 1024: star bodies, manual masks, r-band coverage and
# MaxiMask. It excludes star-halo bits 1 and 2. Other coverage flags and bit
# 2048 are listed here but commented out, since ORing all of them masks
# essentially everything.

# General parameters (can also given on command line)
params:
Expand Down Expand Up @@ -55,15 +54,6 @@ dat:
label: "star bodies"
kind: equal
value: False
# Star-halo bits follow the UNIONS mask producer schema.
- col_name: MASK_1_Faint_star_halos
label: "faint star halos"
kind: equal
value: False
- col_name: MASK_2_Bright_star_halos
label: "bright star halos"
kind: equal
value: False
- col_name: MASK_8_Manual
label: "manual mask"
kind: equal
Expand All @@ -73,7 +63,7 @@ dat:
kind: equal
value: False

# r-band coverage. Required for the OR above to reproduce mask_r.
# r-band coverage.
- col_name: MASK_64_r
label: "r-band imaging"
kind: equal
Expand Down
14 changes: 6 additions & 8 deletions src/sp_validation/galaxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,21 @@
#: not write bit 512). Post-processed v1 comprehensive catalogues carry the same
#: columns, presented under these names by ``sp_validation.grammar``.
#:
#: The r-band default bitmask uses bits 1 (faint star halos), 2 (bright star
#: halos), 4 (star bodies), 8 (manual galaxy mask), 64 (r-band coverage) and
#: 1024 (MaxiMask). The per-band coverage flags are 16 (u), 32 (g), 64 (r),
#: The default external-mask cut uses bits 4 (star bodies), 8 (manual galaxy
#: mask), 64 (r-band coverage) and 1024 (MaxiMask); star-halo bits 1 and 2 are
#: deliberately excluded. The per-band coverage flags are 16 (u), 32 (g), 64 (r),
#: 128 (i) and 256 (HSC z); 2048 is ``True`` where Pan-STARRS z-band (z2)
#: coverage is absent.
MASK_COLUMNS = tuple(
mask_column(bit) for bit in (1, 2, 4, 8, 16, 32, 64, 128, 256, 1024, 2048)
)

#: Mask columns OR'd together for the default galaxy selection. This set is
#: the ShapePipe r-band default bitmask: their OR matches ``mask_r`` on covered
#: granules (verified on the P3 sky area), with differences at footprint edges
#: without map coverage.
#: Mask columns OR'd together for the default galaxy selection: star bodies,
#: manual masks, r-band coverage and MaxiMask. Star-halo bits are excluded.
#: Deliberately not a blanket OR over MASK_COLUMNS: the other coverage flags
#: (bits 16, 32, 128, 256) and bit 2048 would mask essentially the whole
#: catalogue.
DEFAULT_MASK_COLUMNS = tuple(mask_column(bit) for bit in (4, 1, 2, 8, 64, 1024))
DEFAULT_MASK_COLUMNS = tuple(mask_column(bit) for bit in (4, 8, 64, 1024))


def _column_names(dd):
Expand Down
6 changes: 6 additions & 0 deletions src/sp_validation/tests/test_campaign_readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,12 @@ def setUp(self):
self._dat = make_galaxy_data(5)

def test_default_columns(self):
self.assertEqual(
galaxy.DEFAULT_MASK_COLUMNS,
("MASK_4_Stars", "MASK_8_Manual", "MASK_64_r", "MASK_1024_Maximask"),
)
self.assertNotIn("MASK_1_Faint_star_halos", galaxy.DEFAULT_MASK_COLUMNS)
self.assertNotIn("MASK_2_Bright_star_halos", galaxy.DEFAULT_MASK_COLUMNS)
self._dat["MASK_4_Stars"][0] = True
self._dat["MASK_1024_Maximask"][3] = True

Expand Down
Loading