Repository navigation
Exposure maps: npoint (pointing squares) and ntaken beside nexp - #966
Open
cailmdaley wants to merge 6 commits into
Open
cailmdaley wants to merge 6 commits into
cailmdaley wants to merge 6 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FD35GJ3MDN7ceDhFwxzMbU
…ally Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FD35GJ3MDN7ceDhFwxzMbU
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claude (Opus) on behalf of Cail.
Each campaign now publishes four exposure-count maps instead of two, all at the mask ladder's nside 131072:
npoint_<run>.hsp(new)ntaken_<run>.hsp(new)nexp_<run>.hspnflagged_<run>.hspWhy. nexp follows the real CCD tiling, so with chip gaps, ears and dithers it comes out as a busy pattern, and the counts pile up where two exposures' ears overlap. npoint is a deliberately smooth, somewhat arbitrary pointing count: every exposure is one filled square. It is the v2 counterpart of v1.X's
npoint3 >= 3cut. sp_validation'smask_v2.0.yamlsays v2 has no source for that cut yet, and this map provides one. ntaken alongside nexp gives taken vs successful:ntaken − nexpis the coverage lost to CCDs whose PSF failed validation.On 44 smk-b05 exposures, npoint is 3 almost everywhere, with seams where neighbouring squares overlap. ntaken and nexp carry the CCD pattern.
ntaken − nexppicks out exactly the five CCD footprints that failed PSF validation in that region.What changed
exp_maps.py. The per-exposure fragment is now a packed uint16. Bits 0–2 are coverage (1 pointing square, 2 CCD imaging area, 4 validated CCD) and bits 3–10 are the flagged-pixel count, clipped at 255. A HealSparse record-array map was the obvious alternative, but HealSparse stores record arrays uncompressed (33 MB per exposure). Packed fragments are 2.55 MB median, against 2.13 MB for the uint8 fragments they replace.--exp-dir, what the rule uses) or from the delivered MEFs (--image-mef/--flag-mef, HDU = CCD + 1). split_exp keeps the delivered header's WCS, so the two agree. On exposure 2086785 they gave identical fragments over all 5,373,752 pixels.merge_exposure_maps.pysums the fragments into the four maps. It fails, naming the exposure and the backfill command, if it meets an old-format fragment, and it fails if a count would overflow its dtype.exposure_maps_targets, README,astra.yaml(new decisionmasking.pointing_square, andnexp_map_valid_psf_ccdsextended to cover ntaken),universes/committed.yaml, and the params pin (only theexposure_mapsshell digest moved).Backfilling existing campaigns
Fragments that existing campaigns already wrote are in the old format, and their scratch stores have been reclaimed. Rerunning
exp_maps.pyin raw-MEF mode on the staged exposures rewrites the fragment and itsexp_maps.json, and snakemake then reads the fragment throughdurable_edgeas before. This takes ~14 s per exposure. On Nibi that is about 5k fragments, so one small job.Verification
tests/unit/test_exp_maps.py,test_decisions.pyandtests/workflow: all pass.astra-tools validate: pass.exp_mapsrebuilds and targets all four maps.#960 (comment sweep) touches the same two scripts and will need a small merge.
🤖 Generated with Claude Code
https://claude.ai/code/session_01FD35GJ3MDN7ceDhFwxzMbU