Two-Point

These stages deal with measuring or predicting two-point statistics.

class txpipe.random_cats.TXRandomCat(*args: Any, **kwargs: Any)[source]

Generate a catalog of randomly positioned points

This accounts for the depth being different in each pixel, but probably does still need updates, and testing.

subsample_randoms(binned_output)[source]

Randomly subsample the binned random catalog and saves catalog

This can be used within the 2-point clustering stage for the RR term, to speed up the calculation without losing precision

Currently reloads the binned randoms and saves them

class txpipe.twopoint_fourier.TXTwoPointFourier(*args: Any, **kwargs: Any)[source]

Make Fourier space 3x2pt measurements using NaMaster

This Pipeline Stage computes all auto- and cross-correlations for a list of tomographic bins, including all galaxy-galaxy, galaxy-shear and shear-shear power spectra. Sources and lenses both come from the same shear_catalog and tomography_catalog objects.

The power spectra are computed after deprojecting a number of systematic-dominated modes, represented as input maps.

In the future we will want to include the following generalizations:
  • TODO: specify which cross-correlations in particular to include

    (e.g. which bin pairs and which source/lens combinations).

  • TODO: include flags for rejected objects. Is this included in

    the tomography_catalog?

  • TODO: ell-binning is currently static.

class txpipe.twopoint.TXTwoPoint(*args: Any, **kwargs: Any)[source]

Make 2pt measurements using TreeCorr

This stage make the full set of cosmic shear, galaxy-galaxy lensing, and galaxy density measurements on the tomographic catalog using TreeCorr.

Results are saved to a sacc file.

call_treecorr(i, j, k)[source]

This is a wrapper for interaction with treecorr.

get_patch_dir(input_tag, b)[source]

Select a patch directory for the file with the given input tag and with a bin number/label.

To ensure that if you change the catalog the patch dir will also change, the directory path includes the unique ID of the input file.

Parameters:
  • input_tag (str) – One of the tags in the class’s inputs attribute

  • b (any) – An additional label used as the last component in the returned directory

Returns:

str

Return type:

a directory, which has been created if it did not exist already.

prepare_patches(calcs, meta)[source]

For each catalog to be generated, have one process load the catalog and write its patch files out to disc. These are then re-used later by all the different processes.

Parameters:
  • calcs (list) – A list of (bin1, bin2, bin_type) where bin1 and bin2 are indices or bin labels and bin_type is one of the constants SHEAR_SHEAR, SHEAR_POS, or POS_POS.

  • meta (dict) – A dict to which the number of patches (or zero, if no patches) will be added for each catalog type, with keys “npatch_shear”, “npatch_pos”, and “npatch_ran”.

read_nbin()[source]

Determine the bins to use in this analysis, either from the input file or from the configuration.

run()[source]

Run the analysis for this stage.

class txpipe.theory.TXTwoPointTheoryReal(*args: Any, **kwargs: Any)[source]

Compute theory predictions for real-space 3x2pt measurements. Uses CCL in real space and saves to a sacc file.

class txpipe.theory.TXTwoPointTheoryFourier(*args: Any, **kwargs: Any)[source]

Compute theory predictions for Fourier-space 3x2pt measurements. Also uses CCL and saves to a sacc file

class txpipe.jackknife.TXJackknifeCenters(*args: Any, **kwargs: Any)[source]

Generate jack-knife centers from random catalogs.

This uses TreeCorr but cuts down the amount of data by taking only every n’th point.

plot(ra, dec, patch)[source]

Plot the jackknife regions.