From 7d27896f49bc55a9788c59c3301e462a5590d98b Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 12 Aug 2026 20:38:45 +0000 Subject: [PATCH] fix: correct unphysical ell_comps in tutorial 3 model-fitting exercise MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The manual model-fitting exercise at the end of tutorial 3 shipped `ell_comps=(0.5, 0.9)` as its deliberately-poor starting guess. That pair has magnitude f = 1.0296, and the axis ratio is q = (1 - f) / (1 + f), so it implies q = -0.015 — an ellipse with negative axis ratio, which has no geometric meaning. The value was always unphysical; it only became visible when PyAutoGalaxy added the `EllProfile` guard that rejects f >= 1. Use `(0.5, 0.5)` instead: f = 0.707, q = 0.17. Still a wildly wrong starting point against the simulator's true bulge (axis_ratio=0.9, angle=45deg, i.e. ell_comps ~ (0.053, 0.0)), so the exercise keeps its "adjust these to improve the fit" pedagogy, but the profile is now geometrically valid. Applied to the script and to both generated mirrors (notebook, markdown) so the scripts and notebooks smoke legs agree. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01K4jSvqKzCMvqcF4b3wWXFq --- markdown/chapter_1_introduction/tutorial_3_fitting.md | 2 +- notebooks/chapter_1_introduction/tutorial_3_fitting.ipynb | 2 +- scripts/chapter_1_introduction/tutorial_3_fitting.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/markdown/chapter_1_introduction/tutorial_3_fitting.md b/markdown/chapter_1_introduction/tutorial_3_fitting.md index c70486e..d931634 100644 --- a/markdown/chapter_1_introduction/tutorial_3_fitting.md +++ b/markdown/chapter_1_introduction/tutorial_3_fitting.md @@ -938,7 +938,7 @@ galaxy = ag.Galaxy( redshift=0.5, bulge=ag.lp.Sersic( centre=(1.0, 10), # These are the parameters - ell_comps=(0.5, 0.9), # you need to adjust + ell_comps=(0.5, 0.5), # you need to adjust intensity=1.0, # to try and improve effective_radius=1.0, # the model's fit sersic_index=1.0, # to the data! diff --git a/notebooks/chapter_1_introduction/tutorial_3_fitting.ipynb b/notebooks/chapter_1_introduction/tutorial_3_fitting.ipynb index 601771a..63fd018 100644 --- a/notebooks/chapter_1_introduction/tutorial_3_fitting.ipynb +++ b/notebooks/chapter_1_introduction/tutorial_3_fitting.ipynb @@ -1042,7 +1042,7 @@ " redshift=0.5,\n", " bulge=ag.lp.Sersic(\n", " centre=(1.0, 10), # These are the parameters\n", - " ell_comps=(0.5, 0.9), # you need to adjust\n", + " ell_comps=(0.5, 0.5), # you need to adjust\n", " intensity=1.0, # to try and improve\n", " effective_radius=1.0, # the model's fit\n", " sersic_index=1.0, # to the data!\n", diff --git a/scripts/chapter_1_introduction/tutorial_3_fitting.py b/scripts/chapter_1_introduction/tutorial_3_fitting.py index 66e496b..61bd7b2 100644 --- a/scripts/chapter_1_introduction/tutorial_3_fitting.py +++ b/scripts/chapter_1_introduction/tutorial_3_fitting.py @@ -621,7 +621,7 @@ redshift=0.5, bulge=ag.lp.Sersic( centre=(1.0, 10), # These are the parameters - ell_comps=(0.5, 0.9), # you need to adjust + ell_comps=(0.5, 0.5), # you need to adjust intensity=1.0, # to try and improve effective_radius=1.0, # the model's fit sersic_index=1.0, # to the data!