Skip to content

feat: zero-fill extrapolation for input pixelized mass profiles - #508

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/potential-correction-interferometer
Jul 17, 2026
Merged

feat: zero-fill extrapolation for input pixelized mass profiles#508
Jammy2211 merged 1 commit into
mainfrom
feature/potential-correction-interferometer

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Adds a zero-fill extrapolation mode to the input pixelized mass profiles (part of the potential-correction interferometer work, PyAutoLabs/PyAutoLens#623): LinearNDInterpolatorExt(fill="zero") and InputPotential/InputDeflections(extrapolate="zero"). The default ("nearest") is unchanged.

Rationale: when an InputPotential represents a localized correction on a sub-region of a larger grid (an arc-restricted δψ mesh), nearest extrapolation smears constant non-zero potential — and constant spurious deflections — across the entire evaluation grid, scrambling ray-tracing outside the mesh. Zero fill makes the correction vanish outside its support, the physically correct behaviour. Diagnosed on the visibility-space iterative engine (see #623 comments); the iterative engines in PyAutoLens now construct their correction profiles with extrapolate="zero".

API Changes

Added only: the fill parameter on ag.mp.LinearNDInterpolatorExt and the extrapolate parameter on ag.mp.InputPotential / ag.mp.InputDeflections (defaults preserve existing behaviour).
See full details below.

Test Plan

  • 2 new tests: deflections vanish outside the mesh under extrapolate="zero" while nearest smears non-zero values; both modes agree exactly inside the hull; invalid mode raises.
  • Full test_autogalaxy suite run before commit.
Full API Changes (for automation & release notes)

Added

  • ag.mp.LinearNDInterpolatorExt(points, values, fill="nearest")fill="zero" returns 0 outside the convex hull.
  • ag.mp.InputPotential(..., extrapolate="nearest") / ag.mp.InputDeflections(..., extrapolate="nearest")extrapolate="zero" threads zero-fill through all internal interpolators.

Migration

  • None — additive only; defaults unchanged.

Generated by the PyAutoLabs agent workflow.

LinearNDInterpolatorExt gains fill=nearest|zero; InputPotential and
InputDeflections gain extrapolate=nearest|zero (defaults unchanged).
Zero fill makes a localized correction vanish outside its mesh instead
of nearest-smearing spurious constant deflections across the full
evaluation grid — required by the arc-restricted iterative potential
corrections (PyAutoLabs/PyAutoLens#623).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Jul 17, 2026
@Jammy2211
Jammy2211 merged commit a3d1490 into main Jul 17, 2026
5 checks passed
@Jammy2211
Jammy2211 deleted the feature/potential-correction-interferometer branch July 17, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-release PR queued for the next release build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant