Skip to content

docs: normalize __PSF Convolution__ docstring section across simulator.py examples #257

Description

@Jammy2211

Overview

Standardize how the PSF convolution / convolve_over_sample_size input is documented across every simulator.py example in both autolens_workspace and autogalaxy_workspace. The reference simulators get a dedicated __PSF Convolution__ docstring section (in __Contents__), with the over-sample note written as docstring prose rather than a run of # comments. All other example simulators simply gain the convolve_over_sample_size=1 input on their from_gaussian(...) call, with no extra prose (users are assumed to have read the base simulator.py).

Plan

  • Give the reference simulators (imaging/simulator.py in both workspaces, plus group/simulator.py in autolens) a __PSF Convolution__ section: header, __Contents__ entry, and the over-sample explanation converted from # comments into docstring prose.
  • autogalaxy imaging/simulator.py is upgraded from its inline one-liner to the full section (galaxy terminology, ag.).
  • Every other simulator with a real-space Gaussian PSF (38 files) gets convolve_over_sample_size=1 added as the first argument to its from_gaussian(...) call — no header, no prose.
  • Interferometer / point-source-multiple / weak-base simulators (no real-space PSF) are out of scope.
  • CRLF autogalaxy files edited CRLF-safe so each diff stays a single line.
Detailed implementation plan

Affected Repositories

  • autolens_workspace (primary)
  • autogalaxy_workspace

Branch Survey

Repository Current Branch Dirty?
./autolens_workspace main clean (source); generated data products only
./autogalaxy_workspace main clean (source); generated data products only

Suggested branch: feature/psf-convolution-docstring

Implementation Steps

  1. Tier A (full section, 3 files): autolens_workspace/scripts/imaging/simulator.py (add header + Contents entry + prose-ify the existing # over-sample note), autogalaxy_workspace/scripts/imaging/simulator.py (upgrade inline one-liner → full section), autolens_workspace/scripts/group/simulator.py (mirror imaging).
  2. Tier B (input-only, 38 files): insert convolve_over_sample_size=1, as the first arg of each from_gaussian(...) call. Handles single-call, list-comprehension (multi/), and indented variants. CRLF-safe for the 10 autogalaxy CRLF files.
  3. Regenerate notebooks for both workspaces (PyAutoBuild generate.py).
  4. Smoke-check representative simulators run end-to-end.

Key Files

  • autolens_workspace/scripts/imaging/simulator.py — canonical reference (already carries the prose + convolve_over_sample_size code; needs header/Contents/prose-ify).
  • autogalaxy_workspace/scripts/imaging/simulator.py — upgrade to full section.
  • autolens_workspace/scripts/group/simulator.py — mirror imaging.
  • 38 further simulator.py files with from_gaussian — input-only edit.

Original Prompt

Click to expand starting prompt

The new workspaces document the PSF convolution. The reference documentation style is:

"""
All CCD imaging data (e.g. Hubble Space Telescope, Euclid) are blurred by the telescope optics when they are imaged.

The Point Spread Function (PSF) describes the blurring of the image by the telescope optics, in the form of a
two dimensional convolution kernel. The lens modeling scripts use this PSF when fitting the data, to account for
this blurring of the image.

In this example, use a simple 2D Gaussian PSF, which is convolved with the image of the lens and source galaxies
when simulating the dataset.
"""
psf_convolve_over_sample_size = 1

Requirements: each reference simulator.py gets a __PSF Convolution__ docstring section (in Contents), with the over-sample note as docstring prose (not # comments). Other simulators that fold PSF under __Simulate__ don't need the header but should list the input as =1 on the from_gaussian call. group/simulator.py gets the same doc as imaging/simulator.py. Applies to both autogalaxy_workspace and autolens_workspace.

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