From 4305d59ecc373b663a9d27ad28746e1b8cea7576 Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Tue, 10 Mar 2026 16:25:39 +0000 Subject: [PATCH] docs: add module docstrings to interferometer package - Add module-level docstring to fit_interferometer.py describing the uv-plane fitting pipeline - Add module-level docstring to simulator.py explaining galaxy-aware interferometer simulation - Add module-level docstring to model/analysis.py describing AnalysisInterferometer Co-Authored-By: Claude Sonnet 4.6 --- autogalaxy/interferometer/fit_interferometer.py | 13 +++++++++++++ autogalaxy/interferometer/model/analysis.py | 11 +++++++++++ autogalaxy/interferometer/simulator.py | 8 ++++++++ 3 files changed, 32 insertions(+) diff --git a/autogalaxy/interferometer/fit_interferometer.py b/autogalaxy/interferometer/fit_interferometer.py index 7f2e5f87d..1663d697f 100644 --- a/autogalaxy/interferometer/fit_interferometer.py +++ b/autogalaxy/interferometer/fit_interferometer.py @@ -1,3 +1,16 @@ +""" +Fit an interferometer (ALMA/JVLA uv-plane) dataset with a model consisting of one or more galaxies. + +`FitInterferometer` mirrors `FitImaging` but works in the uv-plane: + +1. Compute the sum of all galaxy light profile images. +2. Fourier-transform that image to ``profile_visibilities`` using the dataset's transformer. +3. Subtract from the observed visibilities to create ``profile_subtracted_visibilities``. +4. If linear light profiles or a pixelization are present, fit the residual visibilities via a + linear inversion. +5. Combine the profile visibilities and inversion reconstruction into ``model_data``. +6. Compute residuals, chi-squared, and log-likelihood (or log-evidence when an inversion is used). +""" import numpy as np from typing import Dict, List, Optional diff --git a/autogalaxy/interferometer/model/analysis.py b/autogalaxy/interferometer/model/analysis.py index fca434745..15db5f6d1 100644 --- a/autogalaxy/interferometer/model/analysis.py +++ b/autogalaxy/interferometer/model/analysis.py @@ -1,3 +1,14 @@ +""" +`AnalysisInterferometer` — the **PyAutoFit** `Analysis` class for fitting galaxy models to interferometer data. + +This module provides `AnalysisInterferometer`, which implements `log_likelihood_function` by: + +1. Extracting galaxies from the model instance. +2. Constructing a `FitInterferometer` object from those galaxies and the stored `Interferometer` dataset. +3. Returning the `figure_of_merit` of the fit (log-likelihood or log-evidence). + +It also handles adapt images, visualization, and result wrapping into `ResultInterferometer`. +""" import logging import numpy as np from typing import Optional diff --git a/autogalaxy/interferometer/simulator.py b/autogalaxy/interferometer/simulator.py index 66118e145..9d6189636 100644 --- a/autogalaxy/interferometer/simulator.py +++ b/autogalaxy/interferometer/simulator.py @@ -1,3 +1,11 @@ +""" +Extends the **PyAutoArray** `SimulatorInterferometer` class with galaxy-aware simulation. + +`SimulatorInterferometer` (from `autoarray`) handles the low-level simulation: applying a Fourier +transform and adding visibility noise. This module adds a `via_galaxies_from` method that takes a list +of `Galaxy` objects and a 2D grid, evaluates the galaxy images, and passes them to the parent +simulation pipeline. +""" import numpy as np from typing import List