Add cluster mass-parameterization guide scripts#296
Merged
Conversation
Two companion guides for cluster / group (multi-galaxy lens) mass parameterization, using the model-composition API with free/fixed made explicit and numerical checks throughout: - cluster/mass_parameterizations.py — a tour of the standard Lenstool-style parameterizations (dPIE sigma vs b0; Faber-Jackson scaling relations; mass-anchoring to the BCG; the two-parameter relation freeing r_cut_ref), each model self-contained (halo + individual galaxies + scaling galaxies). - cluster/mass_parameterizations_pyautolens.py — for Lenstool users: maps Lenstool Model 1 onto PyAutoLens's native MGL parameterization. Section 1 is the Lenstool model; Section 2 the standard PyAutoLens mapping (halo dPIE->NFW, galaxies dPIE->Isothermal, sigma->einstein_radius, and the main/extra/scaling coupling spectrum: free / luminosity-bounded / BGC-tied); Section 3 keeps the dPIE truncation on the scaling galaxies while main and extra galaxies stay Isothermal, with the cross-parameterization b0<-> einstein_radius linking. Notebooks regenerated; catalogue (llms-full.txt, workspace_index.json) updated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K5MpYSYekRWVtoUmExAgKB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two companion guide scripts for cluster / group (multi-galaxy lens) mass parameterization, in
scripts/cluster/. Both use the model-composition API, make free vs fixed explicit, and carry numerical checks (parameter-mapping identities verified to machine precision; deflection parity in the SIS limit).cluster/mass_parameterizations.py— the Lenstool-style tourFour self-contained models (each: halo + individual galaxies + scaling galaxies):
sigma, magnitude-anchored Faber-Jackson, BCG freed separately.b0(angular, redshift-free) parameterization.r_cut_refas well.cluster/mass_parameterizations_pyautolens.py— mapping Lenstool → PyAutoLensFor Lenstool users, how/why PyAutoLens re-expresses the model in its native MGL parameterization:
sigma→einstein_radius, and the four-tier coupling spectrum — main (free) / extra (free, luminosity-bounded) / scaling (BGC-tied, 0 free).b0 ↔ einstein_radiuslinking (b0_i = einstein_radius_BGC · (L/L_BGC)^0.5).Notebooks regenerated via PyAutoHands; catalogue (
llms-full.txt,workspace_index.json) updated. Both scripts run end-to-end and all in-script asserts pass.🤖 Generated with Claude Code
https://claude.ai/code/session_01K5MpYSYekRWVtoUmExAgKB