Skip to content

Tomographic rho-/tau-statistics#295

Open
sachaguer wants to merge 11 commits into
feature/sp_validation-extend-to-tomographyfrom
feature/tomo-rho-tau
Open

Tomographic rho-/tau-statistics#295
sachaguer wants to merge 11 commits into
feature/sp_validation-extend-to-tomographyfrom
feature/tomo-rho-tau

Conversation

@sachaguer

Copy link
Copy Markdown
Contributor

This PR upgrades the existing script to compute rho-/tau-statistics to iterate over tomographic bins. Only the tau-statistics change with the bin (the sample of star remains fixed).

The format to call tomographic run is similar to the implementation for pseudo-cl #221. Plotting functions have been upgraded to handle it as well.

The code has run on the GLASS mock, see the plot below for a validation example. The PSF error parameters are consistent with zero at the 2sigma level across the bins.

image

@sachaguer sachaguer self-assigned this Jul 22, 2026
@sachaguer sachaguer added the enhancement New feature or request label Jul 22, 2026
@sachaguer sachaguer linked an issue Jul 22, 2026 that may be closed by this pull request
@sachaguer
sachaguer requested a review from Copilot July 22, 2026 12:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the rho-/tau-statistics workflow to support tomographic bin iteration (tau varies with bin while the star sample remains fixed), and updates plotting/utilities to handle tomographic outputs consistently within the cosmo_val pipeline.

Changes:

  • Add tomographic looping + masking support for tau-statistics computation and plotting in PSFSystematicsMixin.
  • Refactor rho/tau computation helpers to distinguish base_rho vs base_tau, add optional masking/force re-run, and extend covariance options.
  • Update shared basename format to encode tomography metadata, and adjust a pseudo-$C_\ell$ plotting detail.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/sp_validation/rho_tau.py Refactors rho/tau computation + covariance wrappers for tomographic use (base_rho vs base_tau) and adds masking/force-run hooks.
src/sp_validation/cosmo_val/psf_systematics.py Implements tomographic rho/tau computation, PSF-parameter sampling per bin, and tomographic tau plotting.
src/sp_validation/cosmo_val/pseudo_cl.py Tweaks plotting factor computation when jittering $\ell$ values.
src/sp_validation/cosmo_val/core.py Extends basename() to include tomography identifiers in cached output names.
cosmo_val/cat_config.yaml Updates GLASS mock PSF catalog path in configuration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 93 to 96
elif method == "jk":
return get_jackknife_cov(
config,
version,
treecorr_config,
outdir,
base,
npatch=npatch,
config, version, treecorr_config, outdir, base_rho, base_tau
)
def plot_tau_stats(self, plot_tau_m=False):
filenames = [f"tau_stats_{self.basename(ver)}.fits" for ver in self.versions]
# --- calculate functions ---
def calculate_rho_tau_stats(self, tomography=True):
Comment on lines +78 to +101
for ver in self.versions:
# Get the tomographic bins
if tomography:
tomo_bin_ids, tomo_bin_pairs = self._get_tomo_bins(ver)

if tomo_bin_ids is None or tomo_bin_pairs is None:
raise ValueError(
f"Version {ver} does not have tomography information."
)

else:
tomo_bin_ids, tomo_bin_pairs = ["all"], [("all", "all")]

for tomo_bin_id in tomo_bin_ids:
self.print_cyan(f"Computing for the tomographic bin: {tomo_bin_id}")
base_rho = self.basename(ver)
base_tau = self.basename(ver, tomo_bin_a=tomo_bin_id)

# Get the selection for galaxies
mask_gal = self._get_galaxy_mask(ver, tomo_bin_id)

# Get the selection for stars
mask_star = self._get_star_mask(ver)

Comment thread src/sp_validation/rho_tau.py Outdated
Comment on lines +147 to +148
base : str
Base name for output files.
Comment on lines +496 to 500
tomo_bin_a_str = f"tomo_bin_{tomo_bin_a}"
tomo_bin_b_str = f"_tomo_bin_{tomo_bin_b}" if tomo_bin_b is not None else ""
return (
f"{version}_minsep={cfg['min_sep']}"
f"{version}_{tomo_bin_a_str}{tomo_bin_b_str}_minsep={cfg['min_sep']}"
f"_maxsep={cfg['max_sep']}"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will have to be checked whether new outputs are read differently or if the call to open the file relies on the basename function as well.

Comment thread cosmo_val/cat_config.yaml
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 rho-/tau-statistics

2 participants