Skip to content

config: default critical_curves_method to zero_contour#355

Merged
Jammy2211 merged 2 commits intomainfrom
feature/caustic-pixel-scale
Apr 18, 2026
Merged

config: default critical_curves_method to zero_contour#355
Jammy2211 merged 2 commits intomainfrom
feature/caustic-pixel-scale

Conversation

@Jammy2211
Copy link
Copy Markdown
Collaborator

Summary

Flip autogalaxy/config/visualize/general.yaml default critical_curves_method from marching_squares to zero_contour.

Motivation

For slope=2 isothermal lens profiles, marching_squares fabricates a noisy polygonal radial caustic where the radial eigenvalue never cleanly crosses zero (analytically it stays at 1; numerically ellipticity makes it dip near zero, which marching squares picks up as spurious contours). The resulting jagged octagon is not at the physically meaningful 2→1 image transition — it's a sampling artifact.

zero_contour correctly omits the degenerate radial caustic for isothermal profiles and renders clean smooth ovals when one physically exists (verified with slope=1.8).

Runtime: ~2–3× slower per visualize call for the small integration-test dataset, but this is plot-only code — not hit per likelihood evaluation.

API Changes

None — internal config default only. Users who explicitly override critical_curves_method in their own visualize/general.yaml are unaffected. Default behavior changes: caustics/critical curves are now computed via the JAX zero-contour method instead of marching squares.
See full details below.

Test Plan

  • pytest test_autogalaxy/ passes (834/834)
  • autolens_workspace_test/scripts/imaging/visualization.py runs end-to-end; all assertions pass; radial caustic cleanly omitted for slope=2, smooth oval shown for slope=1.8.
Full API Changes (for automation & release notes)

Removed

None.

Added

None.

Changed Behaviour

  • Default value of visualize/general.yaml::general.critical_curves_method changed from "marching_squares" to "zero_contour".
  • Consequence for downstream plotters (_caustics_from, _critical_curves_from in autogalaxy/util/plot_utils.py and autogalaxy/plot/plot_utils.py): they now call tangential_caustic_list_via_zero_contour_from() / radial_caustic_list_via_zero_contour_from() and the corresponding *_critical_curve_list_via_zero_contour_from() methods by default, instead of the marching-squares grid-based variants.
  • For singular power-law profiles (e.g. isothermal, slope=2), the radial caustic is correctly omitted. Previously marching squares would draw a spurious polygonal artifact.
  • For profiles where a radial caustic physically exists, it is rendered as a smooth continuous curve rather than a pixel-aligned polygon.

Migration

  • No user action required for the common case.
  • To restore the previous behavior, set critical_curves_method: marching_squares in a project-local config/visualize/general.yaml.

🤖 Generated with Claude Code

marching_squares fabricates a noisy polygonal radial caustic for slope=2
isothermal profiles where the radial eigenvalue never cleanly crosses zero.
zero_contour correctly omits the degenerate radial caustic and renders clean
smooth ovals when one physically exists.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release Merged PR awaiting inclusion in the next release build label Apr 18, 2026
@Jammy2211
Copy link
Copy Markdown
Collaborator Author

Workspace PR: PyAutoLabs/autolens_workspace_test#29

Now the default critical_curves_method, so it must be installed on all
supported Python versions (including 3.13 CI which skips optional extras).
@Jammy2211 Jammy2211 merged commit 854e70e into main Apr 18, 2026
5 checks passed
@Jammy2211 Jammy2211 deleted the feature/caustic-pixel-scale branch April 18, 2026 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-release Merged PR awaiting inclusion in the next release build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant