Skip to content

feat: cluster + group scaling relations in Lenstool convention (reference-anchored, fixed exponent)#238

Merged
Jammy2211 merged 2 commits into
mainfrom
feature/cluster-scaling-lenstool
Jul 9, 2026
Merged

feat: cluster + group scaling relations in Lenstool convention (reference-anchored, fixed exponent)#238
Jammy2211 merged 2 commits into
mainfrom
feature/cluster-scaling-lenstool

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Moves every scaling-relation composition in the workspace to the reference-anchored convention used by Lenstool and standard in published group/cluster analyses (Limousin et al. 2005; Elíasdóttir et al. 2007; Bergamini et al. 2019), replacing the free two-parameter scaling_factor * L ** scaling_exponent form that referee feedback (assessed in #237) correctly flagged as non-standard:

  • Normalization anchors to a reference galaxy (the brightest scaling member): b0_i = b0_ref * (L_i / L_ref) ** 0.5 — the free parameter is the reference member's lens strength, physically interpretable with an easy-to-motivate prior range (the old scaling_factor had units arcsec/L^β that changed with β).
  • Exponent fixed at the Faber-Jackson value 0.5 (b0 ∝ σ², σ ∝ L^¼), not sampled; the Bergamini et al. 2019 kinematic calibration (σ ∝ L^0.27–0.28, i.e. b0 exponent ≈ 0.55; r_cut exponent from the fundamental plane) is documented as the refinement, and freeing the exponent is shown as a one-line systematics test.
  • Truncation radius scales too: rs_i = rs_ref * (L_i / L_ref) ** 0.5, mirroring Lenstool's r_cut ∝ L^½ (cluster dPIE tier; the group tier uses Isothermal, no truncation radius — prose points at the cluster example).
  • Cluster tier dimensionality drops 2 → 1 free parameter (model N = 13 → 12); prose everywhere explains that only luminosity ratios enter, with the magnitude-catalogue conversion given.

Scripts Changed

  • scripts/cluster/simulator.py — truth relation → reference-anchored (b0_ref = 0.12, exponent 0.5, rs scaled); regenerates dataset/cluster/simple/.
  • scripts/cluster/modeling.py — single free b0_ref (U(0,1)), fixed exponents, rewritten __Scaling Relation__ prose (referee/Lenstool rationale, Bergamini refinement).
  • scripts/cluster/start_here.py — mirrors modeling.py.
  • scripts/cluster/likelihood_function.py — truth-tier rebuild matches the new relation (b0 + rs scaled).
  • scripts/cluster/csv_api.py — prose reference updated.
  • scripts/group/features/scaling_relation/{simulator,modeling,fit,likelihood_function,modeling_for_luminosities}.py — same convention for the group three-tier API (einstein_radius_ref anchored to the brightest member). The group dataset needs no regeneration: both scaling members share L = 0.45, so luminosity ratios are 1 and the truth radii are unchanged.

Not in scope (follow-up noted on the issue): scripts/imaging/features/scaling_relation/, scripts/group/slam.py, guides/advanced/multi_plane.py still show the old form.

Validation

  • Cluster simulator ran end-to-end with the new truth relation: both sources still produce 3 multiple images at sensible positions (point_datasets.csv in the diff); scaling_galaxies.csv regenerated.
  • Model-composition structural check: rebuilt the modeling.py model and asserted prior_count == 12 with b0_ref the tier's only free parameter; instance check confirms the brightest member anchors exactly (b0 = b0_ref, rs = 10.0") and the faintest scales to b0_ref·√(0.05/0.40) (0.354×).
  • Group family: dataset unchanged by construction (equal luminosities → ratios 1); scripts not re-run (fit/likelihood scripts take minutes; convention change is arithmetic-identical at ratio 1).
  • Dataset note: two illustrative PNGs (tracer.png, galaxies_images.png) are deleted in this commit — the old ones depicted the previous truth model; their regeneration via subplot_tracer on the 14-galaxy multi-plane tracer is pathologically slow with current galaxy-scale plot defaults (the exact problem feat: cluster-scale visualization — per-plane critical curves/caustics aplt helpers PyAutoLens#578 addresses) and will be push-appended to this branch if the background render completes, else they regenerate on any user simulator run.
  • Full modeling runs are gated by the known cluster TEST_MODE slowness (no_run.yaml-parked scripts, pre-existing — see feat: LensTool-native dPIE parameterization (from_lenstool) + parity validation PyAutoGalaxy#485 discussion).

Validation checklist (--auto run — in-session directives)

  • Effective level: supervised (header: supervised, cap: feature → supervised); one-shot ship authorized in-session by the user, Heart YELLOW acked in-session
  • Human: convention matches the referee's recommendation as intended?
  • Human: merge, amend, or reject — then log the outcome

🤖 Generated with Claude Code

Reference-anchored normalization (b0_ref / einstein_radius_ref = the brightest
scaling member's lens strength), exponent fixed at Faber-Jackson 0.5 (b0 ∝ σ²,
σ ∝ L^¼), truncation radius scaled rs ∝ L^0.5 (cluster dPIE tier) — replacing
the free two-parameter scaling_factor * L^exponent form flagged by referee
feedback. Tier dimensionality 2→1 (cluster model N=13→12). Bergamini+19
kinematic calibration documented as the refinement; freeing the exponent shown
as a one-line systematics test. Cluster dataset regenerated on the new truth
(b0_ref=0.12 anchored at L_ref=0.40; both sources still triply imaged); group
dataset unchanged (equal member luminosities → ratios 1). Stale prose refs to
the long-dropped centre JSONs fixed in start_here/simulator.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PUuWXiS23FvmfQPLvMNjeM
@Jammy2211 Jammy2211 merged commit 8b35007 into main Jul 9, 2026
8 checks passed
@Jammy2211 Jammy2211 deleted the feature/cluster-scaling-lenstool branch July 9, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-release PR queued for the next release build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant