Skip to content

Update scale-dependent and objectwise leakage computations to tomography - #307

Merged
cailmdaley merged 12 commits into
feature/sp_validation-extend-to-tomographyfrom
feature/tomo-objectwise-leakage
Oct 2, 2026
Merged

cailmdaley merged 12 commits into
feature/sp_validation-extend-to-tomographyfrom
feature/tomo-objectwise-leakage

Conversation

@sachaguer

@sachaguer sachaguer commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

PR related to #299 .

This PR should contain:

  • Scale dependent leakage plotting script refactored to read the output from the rho-/tau-stats pipeline instead of recomputing.
  • Objectwise leakage update for tomography.

Finished for merge (step 2b of #375)

  • Object-wise leakage per bin. It uses Object-wise leakage: row selection and per-bin output suffix, for tomography shear_psf_leakage#48 (merged) for row selection and per-bin output suffixes. The lock now pins shear_psf_leakage develop@f1a2c071. The mask and the regression read the same shear catalogue, HDU 1.
  • Object-wise vs scale-dependent plot. plot_objectwise_leakage(tomography=False) plots ⟨a_ii⟩ against α(θ) per bin. α(θ) comes from the ρ/τ products as τ₀/ρ₀ and is summarised as the weighted mean, the value at the smallest θ, and the affine intercept. That intercept uses absolute σ, with no χ² rescaling. Deriving α from ρ/τ differs numerically from the old star-catalogue estimator; we accept that.
  • ξ_sys error bars. Each bin now uses its own τ variance. Auto pairs reuse one τ draw. Errors come from seeded Monte Carlo, so they are reproducible. Curves use the version colours.
  • Tests. test_psf_leakage.py covers the error propagation, the α summaries, the per-bin object-wise regression and plot on synthetic data, and version skipping. It passes in the container: 8 passed.
  • Not in this PR. The cv_objectwise_leakage rule's ρ/τ inputs. They depend on the workflow's _tomo_bin_all filenames, which Merge develop into the tomography branch #374 aligns.

— Claude on behalf of Cail

@sachaguer sachaguer self-assigned this Aug 24, 2026
@sachaguer sachaguer added the enhancement New feature or request label Aug 24, 2026
@sachaguer sachaguer linked an issue Aug 24, 2026 that may be closed by this pull request
cailmdaley and others added 9 commits October 2, 2026 21:56
_get_alpha_leakage and _compute_scale_dependent_xi_psf_sys draw from
np.random.default_rng(seed) (seed=0 by default) instead of the global
unseeded state, so the plotted error bars are reproducible run to run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JmsgTjEULk4a3t5rppLpbZ
For a == b, xi_psf_sys = tau^2 / rho is one measurement squared; drawing
two independent tau samples underestimated the tau contribution to the
error by sqrt(2). The callback passes same_bin to the helper.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JmsgTjEULk4a3t5rppLpbZ
The tau variances are saved while each bin's table is loaded, so bin a's
draw uses bin a's variance and bin b's uses bin b's, for + and -.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JmsgTjEULk4a3t5rppLpbZ
…from rho/tau

plot_objectwise_leakage(tomography=False, cov_type=None) compares the
object-wise <a_ii> of each version and tomographic bin with the
scale-dependent alpha(theta) = tau_0 / rho_0, summarised as alpha_mean
(inverse-variance weighted mean and std), alpha_1 (smallest theta) and
alpha_0 (intercept of a weighted affine fit). calculate_alpha_leakage_summaries
stores them in leakage_coeff[ver]["tomo_bin_<id>"]; _load_alpha_leakage is
shared with plot_scale_dependent_alpha. Marker is the version, colour the
version (non-tomographic) or the bin. A version missing a catalogue column
is dropped cleanly from the bin loop. The galaxy mask reads HDU 1, the
table LeakageObject.read_data selects rows from. cv_objectwise_leakage
takes the rho/tau products as inputs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JmsgTjEULk4a3t5rppLpbZ
xi_psf_sys: central value, auto-pair error 2|tau|sigma/rho from one tau draw,
cross-pair error from both bins' variances, seed reproducibility. alpha:
central value tau/rho and reproducibility. Summaries recover the affine
intercept. Smoke test: object-wise regression per bin (real
shear_psf_leakage) and the comparison plot, with alpha(theta) stubbed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JmsgTjEULk4a3t5rppLpbZ
…n and per-bin suffix)

Re-locking also brings the lock in line with this branch's pyproject
(glass 2026.2 and the OneCovariance dependencies).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JmsgTjEULk4a3t5rppLpbZ
@cailmdaley
cailmdaley merged commit 476ae55 into feature/sp_validation-extend-to-tomography Oct 2, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tomographic scale dependant and object-wise leakage

2 participants