Repository navigation
fix: point-source and weak-lensing critical-curve grids (clipped / transposed) - #784
Merged
Merged
Conversation
#783) The grid was the multiple images' bounding box (+0.1"), with its y/x extent passed in x-first order, so critical curves extending beyond the images were clipped into disconnected arcs (or lost entirely). critical_curve_grid_from builds a square grid centred on the images, 2x their half-span. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 of 3 tasks
Collaborator
Author
|
Visualization PR: PyAutoLabs/autolens_visualization#10 |
…elper (#783) critical_curve_grid_from moves to autolens/lens/plot/critical_curves.py and is also used by VisualizerWeak (scale=1.0: the source galaxies span the field), whose extent_from() -> from_extent grid was transposed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Point-source critical curves were rendering as 4 disconnected arcs (
fit_image_with_points.png, on PyAutoEyes). BothVisualizerPoint.visualizeandPlotterPoint's fallback computed them onGrid2D.from_extent(extent=dataset.extent_from()). That grid has two problems:extent_from()returns[y_min, y_max, x_min, x_max], butfrom_extenttakes(x0, x1, y0, y1).The new
critical_curve_grid_from(dataset)builds a square grid centred on the images, with half-width 2× their half-span (+0.1"), in x-first extent order. On the visualization dataset, the 4 clipped arcs are now one closed loop of radius 1.6".The same grid is passed to the point visualizer's tracer and galaxy plots, so those now show the full critical curves too.
Weak lensing (added at the human's request):
VisualizerWeakhad the same transposedextent_from()→from_extentgrid. It now uses the same helper withscale=1.0: a square grid covering the source-galaxy field, in (y, x) order. The helper lives in the sharedautolens/lens/plot/critical_curves.py.Closes #783.
API Changes
autolens.lens.plot.critical_curves.critical_curve_grid_from(dataset, shape_native=(100, 100), scale=2.0, buffer=0.1)(any dataset withextent_from).PointDataset.extent_from()is unchanged.See full details below.
Test Plan
pytest test_autolens/: 846 passed, 1 xfailed.Readiness
Heart readiness was YELLOW (score 85) at ship time:
The human explicitly acknowledged this on 2026-10-21. Neither reason involves this change.
Full API Changes (for automation & release notes)
Added
autolens.lens.plot.critical_curves.critical_curve_grid_from(dataset, shape_native=(100, 100), scale=2.0, buffer=0.1) -> Grid2DChanged
VisualizerPoint.visualize/PlotterPoint.fit_pointcritical-curve grid: was the images' bounding box with a transposed extent; it is nowcritical_curve_grid_from(dataset).VisualizerWeak.visualizetracer/galaxies grid: was a transposedextent_from()box; it is nowcritical_curve_grid_from(dataset, scale=1.0).Migration
Generated by the PyAutoLabs agent workflow.
🤖 Generated with Claude Code