Skip to content

feat: oversampled PSF support in SimulatorImaging + workspace example #482

Closed

Description

@Jammy2211

Overview

Follow-up to the oversampled-PSF series (design PyAutoArray#353; chosen as option (a) at the phase-3 sign-off, autolens_workspace#232): support simulation with an oversampled PSF and land the user-facing simulator.py example with it. Run mode: supervised --auto.

Plan

  • PyAutoGalaxy — OperateImage.convolved_padded_image_2d_from(grid, psf, xp) (shared by Galaxies and Tracer): build the padded all-false mask (as padded_grid_from, using psf.kernel_shape_image_resolution), a padded grid with uniform over-sample size s (the existing padded_grid_from pads the border with 1s, which the uniformity guard correctly rejects), evaluate unbinned on its over-sampled coordinates, convolve at the fine resolution (blurring_image=None — all flux in-frame, same as today's padded flow) and return the image-resolution convolved padded image. via_galaxies_from switches on psf.convolve_over_sample_size > 1.
  • PyAutoArray — SimulatorImaging.via_image_from(..., image_is_convolved: bool = False): skip the internal convolution when handed an already-convolved image. Additive, default preserves behaviour.
  • PyAutoLens — the same switch in via_tracer_from (it duplicates the PyAutoGalaxy pattern); trims with kernel_shape_image_resolution.
  • autolens_workspace — extend scripts/imaging/simulator.py with the oversampled-PSF example (fine kernel, convolve_over_sample_size, uniform over-sampling requirement).
  • Tests — unit: s=2 simulation equals brute-force fine construction; s=1 regression parity; noise semantics unchanged. Workspace: extend convolution_over_sampled.py with a simulate-at-s=2 → fit-at-s=2 round trip (chi² ≈ noise expectation).

Prompt: PyAutoMind/issued/oversampled_psf_simulator.md. Suggested branch: feature/psf-oversample-simulator.

🤖 Generated with Claude Code

Activity

  1. Jammy2211 commented on Jul 8, 2026

    @Jammy2211
    CollaboratorAuthor

    Simulator support implemented — at the ship sign-off checkpoint

    Five local commits across the task worktree (not pushed): PyAutoArray (+44/−1), PyAutoGalaxy (+105), PyAutoLens (+82/−1), autolens_workspace (simulator.py example), autolens_workspace_test (round-trip test).

    Verification

    Leg Result
    Round trip simulate noise-free at s=2 → fit same tracer at s=2: chi² ≈ 1e-30 (unit test in PyAutoLens + workspace-level in convolution_over_sampled.py)
    Delta-kernel identity convolved_padded_image_2d_from padded-frame geometry exact to 1e-14
    image_is_convolved pass-through exact; s=1 behaviour byte-identical (default False)
    Suites PyAutoArray 862, PyAutoGalaxy 945, PyAutoLens 336 (each +1 new test)
    Workspace simulator.py (with the new example section) runs clean; convolution_over_sampled.py all sections pass; regenerated tracked dataset files restored before commit (no binary churn)
    Review 5 repos, +281/−2. Verdict: CLEAN
    Implementation notes from_gaussian gained the convolve_over_sample_size pass-through (the example needed it — API completeness); PyAutoLens simulator.py and convolver.py are CRLF files, patched ending-safely

    Ship? Order: PyAutoArray → PyAutoGalaxy → PyAutoLens PRs (pending-release), workspace PRs behind the library merges. On approval + merges, the series queue is just phase 4 (docs) and the refactor follow-up.

    🤖 Generated with Claude Code

  2. Jammy2211 commented on Jul 8, 2026

    @Jammy2211
    CollaboratorAuthor

    🚢 Shipped (human-approved, with the requested per-project simulate-and-fit coverage): every project now has the oversampled round trip — PyAutoArray test_simulator.py (simulator path vs fit-side convolution, exact), PyAutoGalaxy test_simulate_and_fit_imaging.py (via_galaxies_from, chi²≈0), PyAutoLens test_simulate_and_fit_imaging.py (via_tracer_from, chi²≈1e-30). Final suites: 863 / 946 / 336.

    PRs (merge in order): PyAutoArray#359 → PyAutoGalaxy#483 → PyAutoLens#575 → autolens_workspace#233 + autolens_workspace_test#150.

    Notes from the final stretch: PyAutoGalaxy's simulator.py turned out to be CRLF and the original patch silently never applied — the Galaxy round-trip test caught it (the Lens test alone had masked it); also purged test-output artifacts that add -A swept from an untracked test_autoarray/output dir (gitignore gap noted for the refactor sweep).

    🤖 Generated with Claude Code

  3. Jammy2211 commented on Jul 8, 2026

    @Jammy2211
    CollaboratorAuthor

    ✅ Full chain merged in order, each main verified green before proceeding: PyAutoArray#359 → PyAutoGalaxy#483 → PyAutoLens#575 → autolens_workspace#233 + autolens_workspace_test#150. The against-main CI failures resolved exactly as expected once the dependency order was honoured; the navigator catalogue was regenerated in #233. Simulator support for oversampled PSFs is complete, with simulate-and-fit round-trip tests in all three projects.

    🤖 Generated with Claude Code

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