Skip to content

fix: correct HDU indices for dataset.fits reload in results/start_here.py#61

Merged
Jammy2211 merged 1 commit intomainfrom
feature/results-start-here-fits-hdu-fix
May 8, 2026
Merged

fix: correct HDU indices for dataset.fits reload in results/start_here.py#61
Jammy2211 merged 1 commit intomainfrom
feature/results-start-here-fits-hdu-fix

Conversation

@Jammy2211
Copy link
Copy Markdown
Collaborator

Summary

Fix HDU indices in the dataset.fits reload block of scripts/guides/results/start_here.py. The Simple-Loading section was passing data_hdu=0, noise_map_hdu=1, psf_hdu=2, but the visualizer writes dataset.fits with MASK at HDU 0 and the data / noise_map / psf triplet at HDUs 1 / 2 / 3. The off-by-one made psf_hdu=2 pull the 100×100 noise map, which the Convolver rejected with KernelException: "Convolver Convolver must be odd", crashing the script end-to-end.

Scripts Changed

  • scripts/guides/results/start_here.py — bumped data_hdu 0→1, noise_map_hdu 1→2, psf_hdu 2→3 in the FITS-reload block (lines 233–235) so the kwargs match the visualizer's actual HDU layout: MASK, DATA, NOISE_MAP, PSF, OVER_SAMPLE_SIZE_LP, OVER_SAMPLE_SIZE_PIXELIZATION.

Test Plan

  • PYAUTO_TEST_MODE=1 python scripts/guides/results/start_here.py runs to completion from a clean output/results_folder (clean-fit case).
  • Same script re-run against the cached fit also runs to completion (resume case — exercises the patched from_fits).
  • Regression: aggregator/{galaxies_fit,samples,samples_via_aggregator}.py still pass.
  • scripts/check_sizes.sh reports "all scripts within size tolerance".

🤖 Generated with Claude Code

…e.py

The Simple-Loading section reloaded the saved dataset.fits with
data_hdu=0, noise_map_hdu=1, psf_hdu=2, but the visualizer writes the
file as MASK at HDU 0 and the data/noise_map/psf triplet starting at
HDU 1. With the wrong shift, psf_hdu=2 pulled the 100x100 noise map
and the Convolver constructor rejected it with KernelException
("Convolver must be odd"), crashing start_here.py. Shift indices by
one so the kwargs match the visualizer's HDU layout.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label May 8, 2026
@Jammy2211 Jammy2211 merged commit 3877d18 into main May 8, 2026
5 checks passed
@Jammy2211 Jammy2211 deleted the feature/results-start-here-fits-hdu-fix branch May 8, 2026 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-release PR queued for the next release build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant