Skip to content

feat: WeakDataset catalog IO + reduced shear (weak series step 7a)#589

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/weak-real-data
Jul 9, 2026
Merged

feat: WeakDataset catalog IO + reduced shear (weak series step 7a)#589
Jammy2211 merged 1 commit into
mainfrom
feature/weak-real-data

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Real-catalogue interface for the weak-lensing series (phase 7a of #588): WeakDataset.from_arrays / to_csv / from_csv / from_fits (FITS binary tables with explicit column mapping), inverse-variance weights= (σ = w^(−1/2)), optional per-galaxy source-redshift storage, and end-to-end reduced shearSimulatorShearYX(reduced=True) simulates g = γ/(1−κ), WeakDataset.is_reduced declares it, FitWeak computes the matching model quantity via the same Hessian primitive. Loaders default is_reduced=True (real catalogues measure ellipticities); the simulator defaults to plain γ, matching the earlier tutorials.

API Changes

Added only — no existing symbol removed, renamed or changed; WeakDataset.__init__ gains optional redshifts= / is_reduced= (defaults preserve existing behaviour and JSON round-trips).

Test Plan

  • Full test_autolens/ suite: 364 passed (48 weak, 7 new).
  • Loader validation (noise xor weights), csv/fits/json round trips incl. redshifts, weights→σ conversion.
  • Reduced-shear round trip (simulator+fit zero residuals), |g|>|γ| everywhere for SIS, and a mislabel guard (plain data fitted as reduced must not round-trip).

Validation checklist (--auto run)

🤖 Generated with Claude Code

Real-catalogue interface for the weak-lensing series (phase 7a of #588):

- WeakDataset.from_arrays / to_csv / from_csv (columns name,y,x,gamma_2,
  gamma_1,noise[,redshift]) and from_fits (binary table, explicit column
  mapping, hdu select) — loaders default is_reduced=True since real
  catalogues measure ellipticities (reduced shear)
- weights= alternative to noise_map on all loaders (sigma = w**-0.5)
- Optional per-galaxy redshifts stored for provenance / future sigma_crit
  scaling (single-effective-source-plane remains the fit assumption)
- Reduced shear g = gamma/(1-kappa): SimulatorShearYX(reduced=True) simulates
  it (convergence via the same Hessian dispatch), WeakDataset.is_reduced
  declares it, FitWeak computes the matching model quantity
- 7 new tests: loader validation, csv/fits/json round trips, weights
  conversion, reduced round-trip + mislabel guard

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Jul 9, 2026
@Jammy2211 Jammy2211 merged commit 03a54e9 into main Jul 9, 2026
4 checks passed
@Jammy2211 Jammy2211 deleted the feature/weak-real-data branch July 9, 2026 14:01
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