Skip to content

feat: cluster scaling relation in Lenstool convention (reference-anchored, fixed exponent, r_cut scaling) #237

Description

@Jammy2211

Overview

The cluster scaling tier currently fits b0 = scaling_factor * L^scaling_exponent with both parameters free (U(0,1) × U(0,2)) and ra/rs fixed tier-wide. Referee feedback (assessed and confirmed in PyAutoMind research, 2026-07-08) and Lenstool convention say: anchor the normalization to a reference galaxy, fix the exponent from Faber-Jackson, and scale the truncation radius too. This task moves the cluster workspace scripts (and the group-scale scaling-relation feature docs) to that convention.

Autonomy: supervised --auto with in-session one-shot ship authorization (user directive 2026-07-08: "do next two phases one shot --auto"). Judgment note: the Brain Feature Agent suggested research-first re-homing; overridden — the research is complete and encoded in the prompt (issued/-bound feature/cluster/7_scaling_relation_lenstool_convention.md).

Plan

  • scripts/cluster/simulator.py: generate the scaling-tier truth on the reference-anchored relation b0_i = b0_ref * (L_i/L_ref)^0.5 and rs_i = rs_ref * (L_i/L_ref)^0.5, with the brightest member as reference. CSV schema unchanged (y, x, luminosity); prose states luminosities are relative (only L_i/L_ref matters).
  • scripts/cluster/modeling.py: scaling tier composes b0_ref as the single free tier parameter (interpretable as the reference member's lens strength, prior U(0, 3) arcsec), exponent fixed at 0.5 (Faber-Jackson: b0 ∝ σ² ∝ L^0.5; Bergamini et al. 2019 kinematic calibration 2α ≈ 0.55 documented as the refinement), rs_i scaled with fixed exponent 0.5 from rs_ref. Tier dimensionality drops 2 → 1; model N=13 → 12. The old free-(factor, exponent) form stays documented as an option.
  • scripts/cluster/start_here.py: mirror modeling.py.
  • scripts/group/features/scaling_relation/modeling.py + modeling_for_luminosities.py: same convention + prose so group and cluster tell one story.
  • Validate: simulator regeneration + both cluster scripts end-to-end in PYAUTO_TEST_MODE=2; smoke the cluster folder.
Detailed implementation plan

Affected Repositories

  • autolens_workspace (primary — workspace-only; deliberately does NOT depend on the in-flight dPIEMassLenstool library PR, since b0-convention with fixed exponent 0.5 is mathematically identical to Lenstool's σ-scaling)

Branch Survey

Repository Current Branch Dirty?
./autolens_workspace main dirty (pre-existing dataset regeneration artifacts; worktree branches from origin/main)

Suggested branch: feature/cluster-scaling-lenstool
Worktree: ~/Code/PyAutoLabs-wt/cluster-scaling-lenstool/

Implementation Steps

  1. simulator.py: truth relation constants → reference-anchored form; keep 10 members, luminosities log-spaced; write CSV as today.
  2. modeling.py: replace the shared (scaling_factor, scaling_exponent) prior pair with b0_ref + fixed scaling_exponent = 0.5; derived per-member b0_i = b0_ref * (lum_i/lum_ref)**0.5; add rs_i = rs_ref * (lum_i/lum_ref)**0.5 (rs_ref fixed at truth, documented as freeable); update the Scaling Relation prose (referee/Lenstool rationale, α interpretation, dimensionality, Bergamini refinement, magnitudes ↔ relative luminosities).
  3. start_here.py: mirror.
  4. group feature scripts: same reparameterization + one-story prose.
  5. Auto-sim guards already check scaling_galaxies.csv; the truth-relation change regenerates datasets on first run — verify multiple images still land at sensible positions (simulator prints).

Key Files

  • autolens_workspace/scripts/cluster/{simulator,modeling,start_here}.py
  • autolens_workspace/scripts/group/features/scaling_relation/{modeling,modeling_for_luminosities}.py

Original Prompt

Click to expand starting prompt

$(cat PyAutoMind/feature/cluster/7_scaling_relation_lenstool_convention.md)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions