sp_validation.rho_tau

class SquareRootScale(axis, **kwargs)[source]

Bases: ScaleBase

ScaleBase class for generating square root scale.

Usage example: axis.set_yscale(‘squareroot’)

name = 'squareroot'
set_default_locators_and_formatters(axis)[source]

Set the locators and formatters of axis to instances suitable for this scale.

limit_range_for_scale(vmin, vmax, minpos)[source]

Return the range vmin, vmax, restricted to the domain supported by this scale (if any).

minpos should be the minimum positive value in the data. This is used by log scales to determine a minimum value.

class SquareRootTransform(shorthand_name=None)[source]

Bases: Transform

input_dims = 1

The number of input dimensions of this transform. Must be overridden (with integers) in the subclass.

output_dims = 1

The number of output dimensions of this transform. Must be overridden (with integers) in the subclass.

is_separable = True

True if this transform is separable in the x- and y- dimensions.

transform_non_affine(a)[source]

Apply only the non-affine part of this transformation.

transform(values) is always equivalent to transform_affine(transform_non_affine(values)).

In non-affine transformations, this is generally equivalent to transform(values). In affine transformations, this is always a no-op.

Parameters:

values (array) – The input values as an array of length input_dims or shape (N, input_dims).

Returns:

The output values as an array of length output_dims or shape (N, output_dims), depending on the input.

Return type:

array

inverted()[source]

Return the corresponding inverse transformation.

It holds x == self.inverted().transform(self.transform(x)).

The return value of this method should be treated as temporary. An update to self does not cause a corresponding update to its inverted copy.

has_inverse = True

True if this transform has a corresponding inverse transform.

class InvertedSquareRootTransform(shorthand_name=None)[source]

Bases: Transform

input_dims = 1

The number of input dimensions of this transform. Must be overridden (with integers) in the subclass.

output_dims = 1

The number of output dimensions of this transform. Must be overridden (with integers) in the subclass.

is_separable = True

True if this transform is separable in the x- and y- dimensions.

transform(a)[source]

Apply this transformation on the given array of values.

Parameters:

values (array-like) – The input values as an array of length input_dims or shape (N, input_dims).

Returns:

The output values as an array of length output_dims or shape (N, output_dims), depending on the input.

Return type:

array

inverted()[source]

Return the corresponding inverse transformation.

It holds x == self.inverted().transform(self.transform(x)).

The return value of this method should be treated as temporary. An update to self does not cause a corresponding update to its inverted copy.

has_inverse = True

True if this transform has a corresponding inverse transform.

get_transform()[source]

Return the .Transform object associated with this scale.

_extract_xip(correlations)[source]

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

get_params_rho_tau(cat, survey='other')[source]
get_rho_tau_w_cov(config, version, treecorr_config, outdir, base, method, cov_rho=False, npatch=None)[source]

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

get_rho_tau(config, version, treecorr_config, outdir, base, cov_rho=False, npatch=None)[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.

get_theory_cov(config, version, treecorr_config, outdir, base, nbin_ang=100, nbin_rad=100)[source]

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

get_jackknife_cov(config, version, treecorr_config, outdir, base, npatch, ncov=100)[source]

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

get_samples(psf_fitter, version, base, cov_type='jk', apply_debias=None, sampler='emcee')[source]

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

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

  • version (str) – Catalog identifier whose rho/tau statistics are sampled.

  • base (str) – Precomputed basename (e.g. SP_v1.4_minsep=…) used for 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').

get_samples_emcee(psf_fitter, version, base, 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.

  • version (str) – Catalog identifier whose rho/tau statistics are sampled.

  • base (str) – Precomputed basename for locating 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, version, base, 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.

  • version (str) – Catalog identifier whose rho/tau statistics are sampled.

  • base (str) – Precomputed basename for locating 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').