Skip to content

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

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#135
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 noise_map_hdu=1 pull the data array (whose lens-residual pixels are negative), tripping the check_noise_map validation in Imaging.__init__ with DatasetException: A value in the noise-map of the dataset is -0.0367 ... less than or equal to zero. (At native image sizes the same off-by-one also routes the noise map into the PSF slot and crashes the Convolver with the same KernelException reported in autogalaxy_workspace#61.)

This is the autolens_workspace counterpart to the already-merged PyAutoLabs/autogalaxy_workspace#61 and applies the same three-line fix.

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 249–251) 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

  • python scripts/guides/results/start_here.py runs to completion (exit 0) under PYAUTO_SMALL_DATASETS=1 from a clean output folder.
  • Same script re-run against the cached fit also runs to completion (resume case — exercises the patched from_fits).

🤖 Generated with Claude Code

@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label May 8, 2026
@Jammy2211 Jammy2211 merged commit 612ccf0 into main May 8, 2026
5 checks passed
@Jammy2211 Jammy2211 deleted the feature/results-start-here-fits-hdu-fix branch May 8, 2026 09:28
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