Skip to content

fix: point-source critical curves clipped into arcs by a too-small grid #783

Closed

Description

@Jammy2211

Overview

Point-source critical curves render as 4 disconnected arcs on the fit_image_with_points.png figures (PyAutoEyes, both point domains). The point visualizer computes them on a grid covering only the multiple images' bounding box (+0.1"), but critical curves often extend beyond the images, so the contour is clipped. Separately, PointDataset.extent_from() returns [y_min, y_max, x_min, x_max] while Grid2D.from_extent expects (x0, x1, y0, y1), which transposes the box.

On the autolens_visualization dataset, the box grid spans about [-1.14, 1.71]". The true tangential curve is a closed loop of radius 1.6": 4 arcs on the box grid versus one closed 257-point line on a full grid.

Plan

  • PyAutoLens: compute point-source critical curves on a square grid centred on the images, 2× their half-span, with the correct x/y order. Used by both the visualizer and the PlotterPoint fallback. Regression test: the curve is closed.
  • autolens_visualization: re-render both point domains and rebuild the manifest after the library PR merges (CI uses library main).
  • PyAutoEyes: dashboard_refresh after the viz PR merges.

Tier: judge — merge mode: human /prm

Detailed implementation plan

Affected Repositories

  • PyAutoLens (primary)
  • autolens_visualization

Suggested branch: feature/point-critical-curve-grid

Implementation Steps

  1. autolens/point/model/visualizer.py: helper _critical_curve_grid_from(dataset, shape_native=(100, 100), scale=2.0). It takes the positions' bounding-box centre (yc, xc) and h = max(y-span, x-span)/2 + 0.1, sets w = scale·h, and returns Grid2D.from_extent(extent=(xc-w, xc+w, yc-w, yc+w), shape_native=...). Used in visualize.
  2. autolens/point/model/plotter.py (~119): use the same helper.
  3. PointDataset.extent_from() stays unchanged (public API). The weak visualizer has the same pattern on a different dataset class: flagged, not changed.
  4. Test: for a tracer whose Einstein radius exceeds the image bounding box, the helper grid yields one closed tangential line. Then the full test_autolens/ suite.
  5. autolens_visualization: re-run both point producers, then gallery_build + --check and ruff format --check.

Original Prompt

Click to expand starting prompt

fix the critical curve

Human, on the plan: "This makes sense, indeed visualization of point source stuff will often use a bigger grid as things like critical curves can extend beyond the multiple images"

Activity

  1. Jammy2211 commented on Oct 21, 2026

    @Jammy2211
    CollaboratorAuthor

    Library PR Created: #784 (845 passed, 1 xfailed). Visualization re-render: PyAutoLabs/autolens_visualization#10. Heart YELLOW acknowledged by the human. Judge tier: human /prm, library first; then the Eyes refresh.

  2. Jammy2211 commented on Oct 21, 2026

    @Jammy2211
    CollaboratorAuthor

    Shipped — 2026-10-21

    Merged by human /prm, library first:

    • PyAutoLens#784: new shared critical_curve_grid_from(dataset, scale=...) in autolens/lens/plot/critical_curves.py builds a square grid in (y,x) order. Point visualizer and plotter use scale 2: critical curves are no longer clipped into arcs (or lost when the images sit inside the curve). The weak-lensing visualizer, added at the human's request, uses scale 1: its field grid is no longer transposed. 846 passed. Pending release.
    • autolens_visualization#10: both point fit_image_with_points.png re-rendered with a closed critical curve.
    • PyAutoEyes: dashboard_refresh run 39598563590 (1010f5c).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions