Skip to content

Wire the UNIONS external healsparse masks into the workflow (MASK_n* columns) - #886

Open
cailmdaley wants to merge 2 commits into
feat/persist-exp-productsfrom
feat/wire-external-masks
Open

Wire the UNIONS external healsparse masks into the workflow (MASK_n* columns)#886
cailmdaley wants to merge 2 commits into
feat/persist-exp-productsfrom
feat/wire-external-masks

Conversation

@cailmdaley

Copy link
Copy Markdown
Contributor

Stacked on #879. Closes #844's mask half; the rest of #844 (tile-side retention) stays open.

#847 removed ShapePipe's mask generation and left the sky-fixed UNIONS masks to be queried per object by make_cat through MASK_EXT_PATHS. The committed config never set it, so no campaign has written a mask column and the merged shear catalogue carries no mask information at all.

This wires it. The DR6 Aug-2026 ugriz bit ladder is staged group-readably at unions-wl/masks/dr6-2026-08 — 11 boolean healsparse maps, nside 131072, True = masked — reached as a third input root SP_INPUT_MASKS beside tiles and exposures. config_tile_Mc.ini names all 11 and carries the bit table; final_cat.param carries the matching MASK_n1MASK_n2048.

Two caveats live with the config, because a cut written without them is wrong. Whether the August regeneration swapped the content of bits 0 and 1 is unconfirmed, so n1|n2 is only safe combined. And n2048 is 1 where there is no Pan-STARRS z2 data, so an OR over every column masks the whole survey. Nothing cuts on these here; sp_validation's IMAFLAGS_ISO cut has to move onto them (CosmoStat/sp_validation issue to follow).

PSF-star selection is untouched: MASK_PATHS in config_exp_psfex.ini stays commented out, keeping the star diet narrow.

Verified: all 11 paths expand and exist through the pipeline config reader; the DAG is unchanged at 1090 jobs; querying the staged maps at 1000 positions from an smk-g6 tile returns sane per-bit fractions (n4 star 8.2%, n1 halo 2.6%, n1024 MaxiMask 3.5%, n2048 = 1.0 exactly as expected off the PS z2 footprint).

🤖 Generated with Claude Code

https://claude.ai/code/session_01QbnPCyzuDNTgkg715pHhar

PR #847 removed ShapePipe's mask generation and left the sky-fixed UNIONS
masks to be queried per object by make_cat via MASK_EXT_PATHS. The committed
config never set it, so no campaign wrote a mask column and the merged shear
catalogue carried no mask information at all.

It does now. The DR6 Aug-2026 ugriz bit ladder is staged group-readably at
/project/def-mjhudson/unions-wl/masks/dr6-2026-08 (11 boolean healsparse maps,
nside 131072, True = masked), reached as a third input root SP_INPUT_MASKS
beside tiles and exposures. config_tile_Mc.ini names all 11 in MASK_EXT_PATHS
and carries the bit table; final_cat.param carries the matching MASK_n1 ..
MASK_n2048, replacing the IMAFLAGS_ISO note.

Two caveats live with the config, because a cut written without them is wrong:
the August regeneration swapped the content of bits 0 and 1, so n1|n2 is only
safe combined; and n2048 is 1 where there is no Pan-STARRS z2 data, so an OR
over every column masks the whole survey. Nothing cuts on these here.

PSF-star selection is untouched: MASK_PATHS in config_exp_psfex.ini stays
commented out.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QbnPCyzuDNTgkg715pHhar
…n type

FITSCatalogue._get_fits_col_type checked `type(col_data[0]) is bool`, which
only matches Python's builtin bool. A numpy bool array's first element is
np.bool_, so it fell through to the float branch and every boolean column
was silently written as float64 {0.0, 1.0}. This hit make_cat's MASK_n*
columns, queried from boolean healsparse maps via mask_query.query_map,
even though the maps, the docs (config_tile_Mc.ini, final_cat.param,
workflow/README.md), and query_map's own docstring all promise a boolean
value (including the off-map sentinel False). Recognizing np.bool_ writes
the FITS 'L' (logical) format instead, matching the promised dtype; no
other code path depended on the float64 widening.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QbnPCyzuDNTgkg715pHhar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant