Repository navigation
feat: S/N map adapt images and AdaptImages.from_result - #763
Merged
Merged
Conversation
…Images.from_result
galaxy_snr_maps_from returns each galaxy's S/N map before the 1% adapt
floor (the HilbertSNR input); soft_snr_maps_from gives AdaptSplit the
same soft S/N signal; AdaptImages.from_result builds a pipeline stage's
adapt images and mesh grids in one call. Galaxy keys may be written
short ("source", "galaxies.source"). galaxy_name_image_dict_via_result_from
gains minimum_percent= and floors a copy instead of the result's maps.
Existing outputs are unchanged. Closes phase 2 of PyAutoGalaxy#762.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 26, 2026
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.
Summary
Phase 2 of making the adapt-mesh-weighting result the default everywhere (closes #762; phase 1 PyAutoLabs/PyAutoArray#717). The "adapt images" built from a result are, by default, per-galaxy signal-to-noise maps (data minus the other galaxies' model images, over the noise map, floored at 1% of the peak). The new
HilbertSNRmesh and the soft AdaptSplit signal need them before that floor. This adds functions named for what they return, and a one-call builder, so a workspace pipeline stage goes from ~18 lines to:Existing calls and outputs are unchanged (
Hilbert,AdaptSplit,galaxy_name_image_dict_via_result_fromdefaults). Depends on PyAutoLabs/PyAutoArray#718 (same branch name; merge that first).API Changes
Adds
galaxy_snr_maps_from,soft_snr_maps_fromandAdaptImages.from_result; galaxy keys inAdaptImagesmay be written short ("source","galaxies.source");galaxy_name_image_dict_via_result_fromgainsminimum_percent=. Theal.exports of the two functions follow in phase 3 (PyAutoLens was claimed by another task);al.AdaptImages.from_resultworks already. See full details below.Test Plan
test_adapt_images.py(16 tests):minimum_percentwith and without a cache (default unchanged, result maps not floored in place);galaxy_snr_maps_fromunfloored;soft_snr_maps_fromincl.galaxy_names; key resolution (full, dotted, short, ambiguous raises, unknown raises);updated_via_instance_fromwith short keys and an unknown key ignored as before;from_resultequal to the manual steps.test_autogalaxy: 1692 passed.AdaptImages.from_resultinsource_pix[2]andsoft_snr_maps_fromin later stages: all 5 searches complete; the 1250 Hilbert points and the source AdaptSplit map equal the project's reference implementation (0.0).Heart
Scoped dev readiness (
pyauto-heart readiness --dev --repos PyAutoArray,PyAutoGalaxy) is GREEN. Shown, non-blocking:PyAutoFit: CI failure(red),release validation FAILED (stage integrate)(red),workspace validation not passing (2 failed, 1 timeout, cloud#45815945322: autofit scripts/plot/emcee_plotter.py, autogalaxy_test scripts/misc/fit_imaging_sparse_operator.py, autogalaxy_test scripts/misc/fit_interferometer_sparse_operator.py)(yellow). The human had authorized a development-only Heart RED override for this task (#762, "Override, proceed"); the scoped gate came back GREEN, so it was not needed. Heart remains RED for release purposes.Full API Changes (for automation & release notes)
Added
autogalaxy.galaxy_snr_maps_from(result)— per-galaxy S/N maps, negatives set to 0, no floor (=galaxy_name_image_dict_via_result_from(result, minimum_percent=0.0)).autogalaxy.soft_snr_maps_from(snr_maps, galaxy_names=None)—aa.image_mesh.soft_snr_map_fromper map; the AdaptSplit input matchingHilbertSNR.autogalaxy.AdaptImages.from_result(result, image_mesh=None, mask=None)— S/N maps, a mesh grid per galaxy inimage_mesh(drawn from its unfloored S/N map, edge points included), soft maps asgalaxy_name_image_dict; mask defaults toresult.mask.autogalaxy.analysis.adapt_images.adapt_images.galaxy_name_key_from(name, keys)— resolves full / dotted / short galaxy names.Changed Signature
galaxy_name_image_dict_via_result_from(result, use_model_images=False, minimum_percent=None)— None uses the config floor (unchanged);0.0gives the maps before the floor.Changed Behaviour
AdaptImages.updated_via_instance_fromresolves short galaxy keys; a short key matching two galaxies raises; keys matching no galaxy are ignored as before.galaxy_name_image_dict_via_result_fromfloors a copy, so the result's own maps (computed without a cache) are no longer floored in place.Migration
dict = al.galaxy_name_image_dict_via_result_from(result=r); cap the source map at 3;Hilbert(pixels=1000, weight_power=3.5, weight_floor=0.01).image_plane_mesh_grid_from(...);append_with_circle_edge_points(...);AdaptImages(galaxy_name_image_dict=dict, galaxy_name_image_plane_mesh_grid_dict={"('galaxies', 'source')": grid})al.AdaptImages.from_result(result=r, image_mesh={"source": al.image_mesh.HilbertSNR(pixels=1000, edge_pixels=30)})Generated by the PyAutoLabs agent workflow.
🤖 Generated with Claude Code