Skip to content

feat: oversampled PSF blurred images — operate/image consumer (phase 2c) #480

Description

@Jammy2211

Overview

Phase 2c of oversampled PSF convolution: the PyAutoGalaxy consumer switch, per §5 of the approved design (PyAutoMind/feature/autoarray/oversampling_design.md, approved in PyAutoLabs/PyAutoArray#353). When the dataset's PSF is oversampled, operate/image.py must evaluate images at the fine resolution before convolving — today the over_sample decorator bins immediately, so the Convolver only ever sees image-resolution arrays.

Depends on PyAutoArray phase 2a (#354, merged as #355). Independent of phase 2b (#356 / PR #357, inversion path).

Design refinement at implementation: instead of threading a binned= kwarg through every image_2d_from signature (Galaxy → Galaxies → light profiles, plus Tracer in PyAutoLens), the oversampled branch evaluates on aa.Grid2DIrregular(grid.over_sampled) — the decorator already passes irregular grids through unbinned, and grid.over_sampled is in per-pixel sub-block order, exactly the oversampled Convolver's input format. No signature changes anywhere; Tracer inherits the behaviour through OperateImage unchanged.

Plan

  • blurred_image_2d_from: when psf.convolve_over_sample_size > 1, evaluate the image and blurring image on the over-sampled irregular grids and pass them to psf.convolved_image_from(..., mask=grid.mask); the LightProfileOperated branch is unchanged (operated images are added at image resolution, unblurred).
  • blurred_image_2d_list_from and galaxy_blurred_image_2d_dict_from: same switch per galaxy image.
  • padded_image_2d_from / unmasked_blurred_image_2d_from stay at image resolution (visualization-only; documented limitation per the design, revisited in the docs phase).
  • Tests (numpy-only): s=1 strict parity; s=2 blurred image through operate/image.py equals the same computation done directly through the phase-2a Convolver API; list/dict variants consistent with the scalar path.

Original Prompt

Click to expand starting prompt

See PyAutoMind/issued/oversampling_phase_2c_autogalaxy_consumer.md (phase 2c split of oversampling_phase_2_core_api.md; design approved in PyAutoArray#353).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions