Skip to content

chore: store cosmos_web_ring extra-galaxy masks as uint8, not float64 - #701

Open
Jammy2211 wants to merge 1 commit into
mainfrom
feature/cosmos-web-ring-mask-dtype
Open

Jammy2211 wants to merge 1 commit into
mainfrom
feature/cosmos-web-ring-mask-dtype

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Every mask_extra_galaxies.fits in dataset/imaging/cosmos_web_ring stored a boolean mask (values 0 and 1) as big-endian float64. This PR re-stores all five as uint8 and keeps the PIXSCALE header card. Nothing about how they load changes: al.Mask2D.from_fits returns the same boolean array as before, with invert=False and invert=True. The masks go from 3,879,360 to 504,000 bytes. The dataset goes from 11,695,680 to 8,320,320 bytes (11.15 → 7.93 MiB).

F115W/F150W keep-or-drop decision: kept. scripts/multi_dataset/start_here.py ships both bands commented out on purpose, so a reader can uncomment them for 4-band modelling with no download step. The dataset is also allowlisted real data in .gitignore. At 7.93 MiB it meets the Witness's "under 8 MB", which holds only in MiB (8.32 MB in decimal units). It stays above clean_slate.sh's 5 MB dataset warning (DATASET_WARN_KB=5120) on purpose: that warning is a size heuristic, and this dataset is a known exception to it.

Closes #700

Scripts Changed

  • None. Data files only:
    • dataset/imaging/cosmos_web_ring/mask_extra_galaxies.fits (209², 354,240 → 48,960 B)
    • dataset/imaging/cosmos_web_ring/wavebands/F115W/mask_extra_galaxies.fits (419², 1,408,320 → 178,560 B)
    • dataset/imaging/cosmos_web_ring/wavebands/F150W/mask_extra_galaxies.fits (419², 1,408,320 → 178,560 B)
    • dataset/imaging/cosmos_web_ring/wavebands/F277W/mask_extra_galaxies.fits (209², 354,240 → 48,960 B)
    • dataset/imaging/cosmos_web_ring/wavebands/F444W/mask_extra_galaxies.fits (209², 354,240 → 48,960 B)

Test Plan

  • Witness script (C:\Users\Jammy\Workspace\Science\scratch\cosmos_web_ring_mask_dtype\witness_masks.py, run from the branch checkout): all 5 masks are uint8, Mask2D.from_fits arrays equal git show origin/main:<file> with invert False/True, dataset 8,320,320 B = 7.93 MiB.
  • Targeted smoke (pyauto-heart smoke --targeted): no curated script references the changed files, so it ran the import check scripts/imaging/modeling.py, which passed (33.2 s).
  • scripts/imaging/start_here.py and scripts/multi_dataset/start_here.py on the smoke profile (Hands repro_command env, PYAUTO_TEST_MODE=2): both rc=0 (33 s, 32 s). git status was clean afterwards, so no mask was rewritten by the run.

Validation checklist (--auto run — plan was not pre-approved)

  • Effective level: safe (header: safe, cap: maintenance → safe); merge mode: auto-merge on green if the Witness passes after a merge slot (tier glance)
  • Plan: on the issue (chore: store cosmos_web_ring extra-galaxy masks as uint8, not float64 #700), written at start. One correction at review: the keep-bands reasoning had cited the wrong threshold (it said the dataset fell below what flagged it; the threshold is 5 MB). The text was fixed; the decision and the files are unchanged.
  • Gate: tests n/a (data-only workspace change, no test module covers it; Witness run instead) · smoke pass (targeted import check + both start_here scripts) · review CLEAN (fresh independent Opus; one text finding F1 fixed, re-judged CLEAN) · Heart dev-ship GREEN for autolens_workspace (no shown reasons)
  • Human: plan sound in hindsight?
  • Human: diff matches plan (no scope creep)?
  • Human: merge, amend, or reject — then log the outcome

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

The five mask_extra_galaxies.fits files hold boolean masks (values 0 and 1)
but were stored as big-endian float64. Re-store them as uint8 with the
PIXSCALE header kept. Mask2D.from_fits loads identical boolean arrays
(invert False and True). Dataset 11,695,680 -> 8,320,320 bytes (7.93 MiB).

F115W/F150W are kept: multi_dataset/start_here.py ships them commented out
for 4-band modelling, and the dataset is allowlisted real data in
.gitignore. It therefore stays above clean_slate.sh's 5 MB dataset warning
on purpose; that warning is a size heuristic, not a limit, for this dataset.

Closes #700

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

chore: store cosmos_web_ring extra-galaxy masks as uint8, not float64

1 participant