sp_validation.rho_tau

_extract_xip(correlations)[source]

Return flattened array of xip values from a list of correlations.

class _CatalogueLoader(info, params)[source]

Bases: object

Supply FITS paths to the file-based rho/tau readers.

The rho/tau consumers (shear_psf_leakage) read FITS HDU 1 from a path. A catalogue that already is exactly that, with no column renamed by the grammar or the entry’s column_map, passes through unchanged. Any other (another HDU, HDF5, a v1 or foreign naming convention) is read through io.Catalogue, keeping only the configured columns, into a temporary FITS file.

_columns(block)[source]
get_params_rho_tau(cat)[source]

Rho/tau parameters for one catalogue-config entry cat.

The jackknife patch count is the entry’s patch_number; a missing key raises KeyError.

get_rho_tau_w_cov(config, version, treecorr_config, outdir, base_rho, base_tau, method, mask_star=None, mask_gal=None, cov_rho=False, ncov=100, **kwargs)[source]

Compute rho/tau statistics and, if requested, their covariance.

get_rho_tau(config, version, treecorr_config, outdir, base_rho, base_tau, mask_star=None, mask_gal=None, cov_rho=False, force_run=False)[source]

Compute rho and tau statistics for a given version of the catalogue.

Parameters:
  • config (dict) – Configuration file.

  • version (str) – Version of the catalogue to use.

  • treecorr_config (dict) – TreeCorr configuration (must include ‘min_sep’, ‘max_sep’, and ‘nbins’).

  • outdir (str) – Output directory.

  • base_rho (str) – Base name for the rho output files.

  • base_tau (str) – Base name for the tau output files.

  • mask_star (array-like, optional) – Boolean selection over the rows of the psf entry, in the order io.open_entry reads them. If None, no masking is applied.

  • mask_gal (array-like, optional) – Boolean selection over the rows of the shear entry, in the order io.open_entry reads them. If None, no masking is applied.

  • cov_rho (bool, optional) – If True, compute the covariance of rho statistics.

  • force_run (bool, optional) – If True, force the computation even if output files already exist.

get_theory_cov(config, version, treecorr_config, outdir, base, nbin_ang=100, nbin_rad=100, compute_minus=True, mask_star=None, mask_gal=None)[source]

Compute an analytical estimate of the covariance matrix of rho and tau-statistics.

CovTauTh takes the survey area and effective galaxy density from the galaxy catalogue after mask_gal. The masks select rows as in get_rho_tau.

get_jackknife_cov(config, version, treecorr_config, outdir, base_rho, base_tau, npatch, ncov=100, mask_star=None, mask_gal=None, force_run=False)[source]

Compute the covariance matrix of rho and tau-statistics using the jackknife method. Also compute rho and tau-statistics.

get_samples(psf_fitter, base_rho, base_tau, cov_type='jk', apply_debias=None, sampler='emcee', nsamples=10000, nwalkers=124)[source]

Return (alpha, beta, eta) samples using emcee or least squares.

Parameters:
  • psf_fitter (PSFFitter) – PSF fitter instance that provides load_* helpers.

  • base_rho (str) – Precomputed basename (e.g. SP_v1.4_minsep=…) used for rho-stat filenames.

  • base_tau (str) – Precomputed basename (e.g. SP_v1.4_minsep=…) used for tau-stat filenames.

  • cov_type (str, optional) – Covariance label ('jk', 'th', or 'sim'). Defaults to 'jk'.

  • apply_debias (int or None, optional) – Jackknife patch count used to debias samples. Disabled when None.

  • sampler (str, optional) – 'emcee' for MCMC sampling, 'lsq' for least squares (default 'emcee').

  • nsamples (int, optional) – Number of samples to draw (default 10000).

  • nwalkers (int, optional) – Number of walkers for the MCMC run (default 124).

get_samples_emcee(psf_fitter, base_rho, base_tau, nwalkers=124, nsamples=10000, cov_type='jk', apply_debias=None)[source]

Draw (alpha, beta, eta) samples using emcee and the tau covariance.

Parameters:
  • psf_fitter (PSFFitter) – PSF fitter instance managing rho/tau statistics and covariances.

  • base_rho (str) – Precomputed basename for locating rho statistics/covariance files.

  • base_tau (str) – Precomputed basename for locating tau statistics/covariance files.

  • nwalkers (int, optional) – Number of walkers for the MCMC run (default 124).

  • nsamples (int, optional) – Number of samples drawn per walker (default 10000).

  • cov_type (str, optional) – Covariance label ('jk'/'th'/'sim'). Defaults to 'jk'.

  • apply_debias (int or None, optional) – Jackknife patch count applied during debiasing. Disabled when None.

get_samples_lsq(psf_fitter, base_rho, base_tau, nsamples=10000, apply_debias=None, cov_type='jk')[source]

Compute least-squares samples of (alpha, beta, eta) using the tau covariance.

Parameters:
  • psf_fitter (PSFFitter) – PSF fitter instance managing rho/tau statistics and covariances.

  • base_rho (str) – Precomputed basename for locating rho statistics/covariance files.

  • base_tau (str) – Precomputed basename for locating tau statistics/covariance files.

  • apply_debias (int or None, optional) – Jackknife patch count applied during debiasing. Disabled when None.

  • cov_type (str, optional) – Covariance label (defaults to 'jk').