Skip to content

Magnification errors from posterior draws in every source_science script (arc phase 7b) - #613

Merged
Jammy2211 merged 6 commits into
mainfrom
feature/magnification-errors-source-science
Nov 2, 2026
Merged

Jammy2211 merged 6 commits into
mainfrom
feature/magnification-errors-source-science

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Closes #610. Every source_science.py script gains a final __Magnification Errors__ section: a quick lens-model fit (Nautilus, PositionsLH), then 100 draws from its posterior, recomputing the source, point and area magnifications for each draw and quoting the median and 68% interval, as LEGGOS II (arXiv:2606.20804) report theirs. The fit is the only slow part of each script, so it runs last.

  • The pixelization quick fits use an isothermal mass. A power law on the imaging dataset pulled the slope to about 2.2 and the magnifications about 40% low; the imaging script cites this.
  • The prose says the errors are statistical only. Measured numbers are quoted only where a full run was done (imaging, imaging MGE, imaging pixelization, interferometer); the multi_galaxy, group and interferometer pixelization scripts explain how to read the errors without quoting unmeasured values.
  • interferometer/simulator.py: the high-resolution section kept dataset_name="simple" and overwrote the simple dataset; it now writes simple_high_resolution.

Scripts Changed

  • scripts/imaging/source_science.py — magnification errors section
  • scripts/imaging/features/multi_gaussian_expansion/source_science.py — magnification errors section
  • scripts/imaging/features/pixelization/source_science.py — magnification errors section; isothermal quick fit
  • scripts/interferometer/source_science.py — magnification errors section
  • scripts/interferometer/features/pixelization/source_science.py — magnification errors section; isothermal quick fit
  • scripts/multi_galaxy/source_science.py — magnification errors section
  • scripts/multi_galaxy/features/multi_gaussian_expansion/source_science.py — magnification errors section
  • scripts/multi_galaxy/features/pixelization/source_science.py — magnification errors section
  • scripts/group/source_science.py — magnification errors section
  • scripts/group/features/multi_gaussian_expansion/source_science.py — magnification errors section
  • scripts/group/features/pixelization/source_science.py — magnification errors section
  • scripts/interferometer/simulator.py — high-resolution section writes its own dataset

Upstream PR

PyAutoLabs/PyAutoFit#1751 (merged, released in 2026.11.1.1)

Test Plan

  • All 11 source_science.py scripts smoke-tested locally (exit 0)
  • Full runs: imaging, imaging MGE, imaging pixelization, interferometer, compared against the simulated truth
  • CI smoke (note: CI runs only smoke_tests.txt, which does not include these scripts)

Follow-ups filed in PyAutoMind: area-magnification fragments near critical curves (draft/bug/autogalaxy/area_magnification_critical_curve_fragments.md) and slow multi_galaxy/group quick fits (draft/docs/autolens_workspace/source_science_multi_galaxy_group_quick_fits_slow.md).

Heart: STALE (release validation incomplete: no rehearsal for current source), acknowledged by the human 2026-11-02; task started under the human's Heart-RED override of 2026-10-31.

🤖 Generated with Claude Code

Jammy2211 and others added 5 commits November 2, 2026 09:07
…ometer source_science (WIP)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…zation source_science (WIP)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dataset

The __Many Visibilities__ section kept dataset_name="simple" and overwrote
simple/data.fits with a simulation on a 0.01" grid, making the visibilities
100x brighter than tracer.json implies on the 0.1" grid the examples fit.
It now writes simple_high_resolution (sma uv coverage; alma via two
commented lines). The simple dataset's noise_sigma drops 1000 -> 10 so its
signal-to-noise (~25 per visibility) is unchanged for every example.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A power law fitted with constant regularization pulled the slope steep
(~2.2 vs a true 2.0) and the posterior magnifications ~40% below the
truth, with a 2h20m laptop fit. The caveat now states that result.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cripts

Measured numbers only where a full run was done (imaging pixelization, interferometer);
the multi_galaxy, group and interferometer pixelization scripts describe how to read the
errors without quoting unmeasured values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ctions

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit c0ea84c into main Nov 2, 2026
8 checks passed
@Jammy2211
Jammy2211 deleted the feature/magnification-errors-source-science branch November 2, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: magnification errors from posterior draws in every source_science.py

1 participant