From 65d85f876c1c17d250a7676b12c4ecd44a863af8 Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Tue, 4 Aug 2026 18:20:19 +0100 Subject: [PATCH] docs: floor lens-light MGE Gaussians at a tenth of the pixel scale MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Phase 2 of the sweep started in autolens_workspace#467. Tutorial 5 builds three MGE ladders by hand. The two lens-light ladders now start at `np.log10(dataset.pixel_scales[0] / 10.0)` instead of a hardcoded -2. The third ladder is the SOURCE MGE and moves from -2 to -4 instead. The source is lensed, so magnification samples the source plane far more finely than the image pixel scale — a pixel-scale floor would truncate real small-scale source structure. -4 is what `mge_model_from` gives a source, so the hand-written tutorial basis now matches the helper it exists to teach. Verified by tracing: the third ladder feeds `source_bulge`, not the lens. Co-Authored-By: Claude Opus 5 --- .../tutorial_5_linear_profiles.ipynb | 12 ++++++------ .../tutorial_5_linear_profiles.py | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/notebooks/chapter_2_lens_modeling/tutorial_5_linear_profiles.ipynb b/notebooks/chapter_2_lens_modeling/tutorial_5_linear_profiles.ipynb index e068271..272ff41 100644 --- a/notebooks/chapter_2_lens_modeling/tutorial_5_linear_profiles.ipynb +++ b/notebooks/chapter_2_lens_modeling/tutorial_5_linear_profiles.ipynb @@ -461,10 +461,10 @@ "source": [ "total_gaussians = 30\n", "\n", - "# The sigma values of the Gaussians will be fixed to values spanning 0.01 to the mask radius, 3.0\".\n", + "# The sigma values of the Gaussians will be fixed to values spanning a tenth of the pixel scale to the mask radius, 3.0\".\n", "\n", "mask_radius = 3.0\n", - "log10_sigma_list = np.linspace(-2, np.log10(mask_radius), total_gaussians)\n", + "log10_sigma_list = np.linspace(np.log10(dataset.pixel_scales[0] / 10.0), np.log10(mask_radius), total_gaussians)\n", "\n", "# A list of linear light profile `Gaussians` will be input here, which will then be used to fit the data.\n", "\n", @@ -563,9 +563,9 @@ "source": [ "total_gaussians = 30\n", "\n", - "# The sigma values of the Gaussians will be fixed to values spanning 0.01 to the mask radius, 3.0\".\n", + "# The sigma values of the Gaussians will be fixed to values spanning a tenth of the pixel scale to the mask radius, 3.0\".\n", "mask_radius = 3.0\n", - "log10_sigma_list = np.linspace(-2, np.log10(mask_radius), total_gaussians)\n", + "log10_sigma_list = np.linspace(np.log10(dataset.pixel_scales[0] / 10.0), np.log10(mask_radius), total_gaussians)\n", "\n", "# By defining the centre here, it creates two free parameters that are assigned below to all Gaussians.\n", "\n", @@ -625,9 +625,9 @@ "source": [ "total_gaussians = 15\n", "\n", - "# The sigma values of the Gaussians will be fixed to values spanning 0.01\" to 1.0\".\n", + "# The sigma values of the Gaussians will be fixed to values spanning 0.0001\" to 1.0\".\n", "\n", - "log10_sigma_list = np.linspace(-2, np.log10(1.0), total_gaussians)\n", + "log10_sigma_list = np.linspace(-4, np.log10(1.0), total_gaussians)\n", "\n", "bulge_gaussian_list = []\n", "\n", diff --git a/scripts/chapter_2_lens_modeling/tutorial_5_linear_profiles.py b/scripts/chapter_2_lens_modeling/tutorial_5_linear_profiles.py index 25be59d..a62ccef 100644 --- a/scripts/chapter_2_lens_modeling/tutorial_5_linear_profiles.py +++ b/scripts/chapter_2_lens_modeling/tutorial_5_linear_profiles.py @@ -261,10 +261,10 @@ """ total_gaussians = 30 -# The sigma values of the Gaussians will be fixed to values spanning 0.01 to the mask radius, 3.0". +# The sigma values of the Gaussians will be fixed to values spanning a tenth of the pixel scale to the mask radius, 3.0". mask_radius = 3.0 -log10_sigma_list = np.linspace(-2, np.log10(mask_radius), total_gaussians) +log10_sigma_list = np.linspace(np.log10(dataset.pixel_scales[0] / 10.0), np.log10(mask_radius), total_gaussians) # A list of linear light profile `Gaussians` will be input here, which will then be used to fit the data. @@ -330,9 +330,9 @@ """ total_gaussians = 30 -# The sigma values of the Gaussians will be fixed to values spanning 0.01 to the mask radius, 3.0". +# The sigma values of the Gaussians will be fixed to values spanning a tenth of the pixel scale to the mask radius, 3.0". mask_radius = 3.0 -log10_sigma_list = np.linspace(-2, np.log10(mask_radius), total_gaussians) +log10_sigma_list = np.linspace(np.log10(dataset.pixel_scales[0] / 10.0), np.log10(mask_radius), total_gaussians) # By defining the centre here, it creates two free parameters that are assigned below to all Gaussians. @@ -381,9 +381,9 @@ """ total_gaussians = 15 -# The sigma values of the Gaussians will be fixed to values spanning 0.01" to 1.0". +# The sigma values of the Gaussians will be fixed to values spanning 0.0001" to 1.0". -log10_sigma_list = np.linspace(-2, np.log10(1.0), total_gaussians) +log10_sigma_list = np.linspace(-4, np.log10(1.0), total_gaussians) bulge_gaussian_list = []