Tomographic rho-/tau-statistics#295
Open
sachaguer wants to merge 11 commits into
Open
Conversation
…ranch for rho-tau-statistics
…ranch for rho-tau-statistics
… the code running and GLASS mocks. Upgrade the sampling of error parameters.
There was a problem hiding this comment.
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_rhovsbase_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 |
| 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 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']}" |
Contributor
Author
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.