Skip to content

Commit f4e6e20

Browse files
authored
Merge pull request #394 from Jammy2211/docs/imaging
docs(imaging): add module-level docstrings to imaging package
2 parents 09c5ebb + 8c909d7 commit f4e6e20

3 files changed

Lines changed: 48 additions & 0 deletions

File tree

autolens/imaging/fit_imaging.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
"""
2+
Imaging fit class for strong gravitational lens modeling.
3+
4+
``FitImaging`` extends the ``autogalaxy`` ``FitImaging`` base class to work with a
5+
``Tracer`` instead of a plain ``Galaxies`` collection. The fit pipeline is the same
6+
six-step process as the base class, with the critical addition that light profiles from
7+
source galaxies are evaluated *after* ray-tracing their image-plane grid through the
8+
lens mass distribution:
9+
10+
1. Evaluate all light profiles of the tracer galaxies on the (ray-traced) grid.
11+
2. Blur the summed image with the imaging PSF.
12+
3. Subtract the blurred image from the data to form the profile-subtracted image.
13+
4. If the tracer contains linear light profiles or pixelizations, solve for their
14+
amplitudes / reconstructed source via an inversion of the profile-subtracted image.
15+
5. Combine blurred image and inversion reconstruction into the ``model_data``.
16+
6. Compute residuals, chi-squared, and log likelihood (or log evidence when an inversion
17+
is present).
18+
19+
The ``TracerToInversion`` helper is used to assemble the linear system in step 4.
20+
"""
121
import copy
222
import numpy as np
323
from typing import Dict, List, Optional

autolens/imaging/model/analysis.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
"""
2+
Analysis class for fitting a ``Tracer`` lens model to an imaging dataset.
3+
4+
``AnalysisImaging`` implements the ``log_likelihood_function`` that a ``PyAutoFit``
5+
non-linear search calls on each iteration. It:
6+
7+
1. Constructs a ``Tracer`` from the current model instance.
8+
2. Optionally applies adaptive galaxy images to linear components.
9+
3. Calls ``FitImaging`` to evaluate the log likelihood.
10+
4. Returns the figure of merit (log likelihood or log evidence).
11+
12+
It also manages result output (``ResultImaging``), on-the-fly visualisation
13+
(``VisualizerImaging``), and position-based priors via ``PositionLikelihood``.
14+
"""
115
import logging
216

317
import autofit as af

autolens/imaging/simulator.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
"""
2+
Imaging simulator for strong gravitational lens observations.
3+
4+
``SimulatorImaging`` extends ``aa.SimulatorImaging`` with a ``via_tracer_from`` method
5+
that accepts a ``Tracer`` object and:
6+
7+
1. Uses the tracer's mass profiles to ray-trace the image-plane grid to the source plane.
8+
2. Evaluates the light profiles of all galaxies on the (traced) grid.
9+
3. Passes the result through the standard ``SimulatorImaging`` pipeline: PSF convolution,
10+
background sky addition, and Poisson noise realisation.
11+
12+
This is the primary entry point for generating synthetic lens datasets for testing,
13+
validation, and mock-data studies.
14+
"""
115
import numpy as np
216
from typing import List
317

0 commit comments

Comments
 (0)