Repository navigation
feat: HilbertSNR point cap and frame-independent interpolation, edge_pixels, shorter arguments - #718
Merged
Merged
Conversation
…ap_from HilbertSNR's share arguments become background= and peak=, and adapt_image_soft_from becomes soft_snr_map_from (both unreleased since #717). Hilbert, HilbertSNR and Overlay take edge_pixels= (default 0), appending the zeroed Delaunay boundary points half a pixel beyond the circular mask's outer edge, so scripts no longer append them by hand. Phase 2 of the adapt-mesh-weighting default (PyAutoGalaxy#762). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 26, 2026
…rpolation HilbertSNR(max_per_pixel=8) water-fills the Hilbert probabilities so no image pixel gets more than 8 points (faint sources had up to 61 in one pixel, hundreds within 0.05 pixels of each other). image_and_grid_from gains frame_independent: bilinear interpolation on the image's own pixel grid, so the mesh no longer depends on the frame around the mask and non-square frames work. On by default for HilbertSNR; Hilbert keeps the original griddata interpolation unless asked (frame_independent=False), so existing results are unchanged. Hilbert's normalised weight map moves into a probabilities_from hook. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 tasks done
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 (PyAutoLabs/PyAutoGalaxy#762; phase 1 #717). The API was settled with the human so a workspace pipeline stage becomes three lines. This PR is the PyAutoArray half; the PyAutoGalaxy PR on the same branch name depends on it (merge this first).
API Changes
Update (second commit):
HilbertSNRnow caps points per image pixel (max_per_pixel=8) and interpolates the adapt data frame-independently (frame_independent=True);Hilbertgainsframe_independent=False(opt-in, so its output is unchanged).Renames two
HilbertSNRarguments and one function added in #717 (merged, not yet released, so no user code depends on them), and adds an optionaledge_pixels=toHilbert,HilbertSNRandOverlay(default 0: unchanged output) so scripts no longer append the Delaunay boundary points by hand. See full details below.Test Plan
max_per_pixel=8) / 3 (=3); on the study's 20 datasets no two points closer than 0.05 px (was 539 on the faintest), median share of points on S/N ≥ 3 0.71 → 0.70.HilbertSNRmesh to 1e-9 (before: points moved up to 6-9 px; non-square raised); bilinear interpolation exact on a linear image;Hilbertdefault unchanged.test_autoarrayafter the second commit: 2632 passed.test_hilbert_snr.py: renamed arguments;edge_pixelson all three image meshes (count, radius = half a pixel beyond the mask's outer edge, other points unchanged).test_autoarray: 2625 passed.AdaptImages.from_resultwithHilbertSNR(pixels=1250, edge_pixels=30): the 1250 Hilbert points equal the referencepeak_sharemesh (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 (PyAutoGalaxy#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)
Renamed
image_mesh.HilbertSNR(background_share=, peak_share=)→image_mesh.HilbertSNR(background=, peak=)(attributes too)image_mesh.adapt_image_soft_from→image_mesh.soft_snr_map_fromChanged Signature
image_mesh.Hilbert(..., edge_pixels=0),image_mesh.HilbertSNR(..., edge_pixels=0),image_mesh.Overlay(..., edge_pixels=0):edge_pixelspoints appended byimage_plane_mesh_grid_fromon a circle of radiusmask.circular_radius + pixel_scale / 2(half a pixel beyond the outer edge of the outermost unmasked pixel). On even-sized frames this is where workspace scripts put them (mask_radius + pixel_scale / 2); on odd-sized frames half a pixel closer.Added
AbstractImageMesh.with_edge_points_from(image_plane_mesh_grid, mask)Added (second commit)
image_mesh.HilbertSNR(..., max_per_pixel=8.0, frame_independent=True)— the cap (None turns it off) and the interpolation switch.image_mesh.Hilbert(..., frame_independent=False)— opt-in bilinear interpolation; default keepsgriddata.image_and_grid_from(..., frame_independent=False);Hilbert.probabilities_from(adapt_data_hb, mask)hook;hilbert_snr.capped_probabilities_from(probabilities, cap)(water-filling); module constantHILBERT_LENGTH = 193.Migration
grid = Hilbert(pixels=1000, ...).image_plane_mesh_grid_from(...)thenappend_with_circle_edge_points(grid, centre=mask.mask_centre, radius=mask_radius + mask.pixel_scale / 2.0, n_points=30)image_mesh = HilbertSNR(pixels=1000, edge_pixels=30);Delaunay(pixels=image_mesh.pixels, zeroed_pixels=image_mesh.edge_pixels)Generated by the PyAutoLabs agent workflow.
🤖 Generated with Claude Code