sp_validation.cosmo_val.pure_eb

Pure E/B-mode decomposition diagnostic.

Provides PureEBMixin, which computes and plots the pure E/B-mode correlation functions (xi+/xi- pure-mode decomposition) for catalog versions.

class PureEBMixin[source]

Bases: object

calculate_pure_eb(version, min_sep=None, max_sep=None, nbins=None, min_sep_int=0.08, max_sep_int=300, nbins_int=1000, npatch=256, var_method='jackknife', cov_path_int=None, cosmo_cov=None, n_samples=1000)[source]

Calculate the pure E/B modes for the given catalog version. The class instance’s treecorr_config will be used for the “reporting” binning by default, but any kwargs passed to this function will overwrite the defaults.

Parameters:
  • version (str) – The catalog version to compute the pure E/B modes for.

  • min_sep (float, optional) – Minimum separation for the reporting binning. Defaults to the value in self.treecorr_config if not provided.

  • max_sep (float, optional) – Maximum separation for the reporting binning. Defaults to the value in self.treecorr_config if not provided.

  • nbins (int, optional) – Number of bins for the reporting binning. Defaults to the value in self.treecorr_config if not provided.

  • min_sep_int (float, optional) – Minimum separation for the integration binning. Defaults to 0.08.

  • max_sep_int (float, optional) – Maximum separation for the integration binning. Defaults to 300.

  • nbins_int (int, optional) – Number of bins for the integration binning. Defaults to 1000.

  • npatch (int, optional) – Number of patches for the jackknife or bootstrap resampling. Defaults to the value in self.npatch if not provided.

  • var_method (str, optional) – Variance estimation method. Defaults to “jackknife”.

  • cov_path_int (str, optional) – Path to the covariance matrix for the reporting binning. Replaces the treecorr covariance matrix if provided, meaning that var_method has no effect on the results although it is still passed to CosmologyValidation.calculate_2pcf.

  • cosmo_cov (pyccl.Cosmology, optional) – Cosmology object to use for theoretical xi+/xi- predictions in the semi-analytical covariance calculation. Defaults to self.cosmo if not provided.

  • n_samples (int, optional) – Number of Monte Carlo samples for semi-analytical covariance propagation. Defaults to 1000.

Returns:

A dictionary containing the following keys:

  • ”xip_E”: Pure E-mode correlation function for xi+.

  • ”xim_E”: Pure E-mode correlation function for xi-.

  • ”xip_B”: Pure B-mode correlation function for xi+.

  • ”xim_B”: Pure B-mode correlation function for xi-.

  • ”xip_amb”: Ambiguity mode for xi+.

  • ”xim_amb”: Ambiguity mode for xi-.

  • ”cov”: Covariance matrix for the pure E/B modes.

  • ”gg”: The two-point correlation function object for the reporting binning.

  • ”gg_int”: The two-point correlation function object for the integration binning.

  • ”eb_samples”: (only when using semi-analytical covariance) Semi-analytic EB samples used for covariance calculation. Shape: (n_samples, 6*nbins)

Return type:

dict

Notes

  • A shared patch file is used for the reporting and integration binning, and is created if it does not exist.

plot_pure_eb(versions=None, output_dir=None, fiducial_xip_scale_cut=None, fiducial_xim_scale_cut=None, min_sep=None, max_sep=None, nbins=None, min_sep_int=0.08, max_sep_int=300, nbins_int=1000, npatch=None, var_method='jackknife', cov_path_int=None, cosmo_cov=None, n_samples=1000, results=None, **kwargs)[source]

Generate comprehensive pure E/B mode analysis plots.

Creates four types of plots for each version: 1. Integration vs Reporting comparison 2. E/B/Ambiguous correlation functions 3. 2D PTE heatmaps 4. Covariance matrix visualization

Parameters:
  • versions (list, optional) – List of catalog versions to process. Uses self.versions if None.

  • output_dir (str, optional) – Output directory for plots. Uses configured output path if None.

  • fiducial_xip_scale_cut (tuple, optional) – (min_scale, max_scale) for xi+ fiducial analysis, shown as gray regions

  • fiducial_xim_scale_cut (tuple, optional) – (min_scale, max_scale) for xi- fiducial analysis, shown as gray regions

  • min_sep (float, float, int, optional) – Binning parameters for reporting scale. Uses treecorr_config if None.

  • max_sep (float, float, int, optional) – Binning parameters for reporting scale. Uses treecorr_config if None.

  • nbins (float, float, int, optional) – Binning parameters for reporting scale. Uses treecorr_config if None.

  • min_sep_int (float, float, int) – Binning parameters for integration scale (default: 0.08-300 arcmin, 1000 bins)

  • max_sep_int (float, float, int) – Binning parameters for integration scale (default: 0.08-300 arcmin, 1000 bins)

  • nbins_int (float, float, int) – Binning parameters for integration scale (default: 0.08-300 arcmin, 1000 bins)

  • npatch (int, optional) – Number of patches for jackknife covariance. Uses self.npatch if None.

  • var_method (str) – Variance method (“jackknife” or “semi-analytic”). Automatically set to “semi-analytic” when cov_path_int is provided.

  • cov_path_int (str, optional) – Path to integration covariance matrix for semi-analytical calculation

  • cosmo_cov (pyccl.Cosmology, optional) – Cosmology for theoretical predictions in semi-analytical covariance

  • n_samples (int) – Number of Monte Carlo samples for semi-analytical covariance (default: 1000)

  • results (dict or list, optional) – Precalculated results to avoid recomputation. Can be a single results dict for one version, or a list of results dicts for multiple versions. If None (default), results will be calculated using calculate_pure_eb.

  • **kwargs (dict) – Additional arguments passed to calculate_eb_statistics

Notes

This function orchestrates the full E/B mode analysis workflow:

  • Uses instance configuration as defaults for unspecified parameters

  • Automatically switches to analytical variance when theoretical covariance provided

  • Generates standardized output file naming based on all analysis parameters

  • Delegates individual plot generation to specialized functions in b_modes module