API reference

class lya_2pt.Interface(config)[source]

Coordinate configuration parsing, tracer loading, and correlation runs.

Parameters:

config (configparser.ConfigParser) – Configuration containing tracer, cosmology, computation, output, and export sections.

ang_max

Maximum angular separation used when finding neighbouring tracers.

Type:

float

auto_flag

Whether the configuration describes an auto-correlation.

Type:

bool

nside

HEALPix nside value used to find neighbouring pixels.

Type:

int

read_tracers(files=None)[source]

Read the tracers

Parameters:
  • files (array[Path], optional)

  • read (List of delta files to)

  • None (by default)

run(healpix_ids=None)[source]

Run the computation

This can include the correlation function, the distortion matrix, and/or the metal distortion matrix, depending on the configuration

Parameters:
  • healpix_ids (array[int], optional)

  • on (List of healpix_ids to run)

  • None (by default)

Utilities

lya_2pt.utils.check_dir(dir: Path)[source]

Create dir when it does not already exist.

lya_2pt.utils.compute_ang_max(cosmo, rt_max, z_min, z_min2=None)[source]

Computes the maximum angular separation we need to look for neighbours

Parameters:
  • comso (Cosmology)

  • distances (Fiducial cosmology used to go from angles and redshift to)

  • rt_max (float)

  • separation (Maximum transverse)

  • z_min (use)

  • data (Minimum redshift of the first set of)

  • z_min2 (float or None - default: None)

  • None (Minimum redshift of the second set of data. If)

  • z_min

Returns:

  • ang_max (float)

  • The maximum anglular separation

lya_2pt.utils.find_path(path, enforce=True)[source]

Find paths on the system.

Parameters:
  • path (string) – Input path. Can be absolute or relative to lya_2pt

  • enforce (bool) – Flag for enforcing that the path exists

lya_2pt.utils.parse_config(config, defaults, accepted_options)[source]

Parse the given configuration

Check that all required variables are present Load default values for missing optional variables

Parameters:
  • config (configparser.SectionProxy)

  • options (Configuration)

  • defaults (dict)

  • section (The accepted keys for the given config)

  • accepted_options (list of str)

  • section

Returns:

  • config (configparser.SectionProxy)

  • Parsed options to initialize class

Errors

This file defines the error classes used by lya_2pt

exception lya_2pt.errors.CosmologyError[source]

Exceptions occurred in class Cosmology

exception lya_2pt.errors.FindBinsError[source]

Exceptions occurred in parsing

exception lya_2pt.errors.MPIError[source]

Exceptions related to MPI parallelization

exception lya_2pt.errors.ParserError[source]

Exceptions occurred in parsing

exception lya_2pt.errors.ReaderException[source]

Exceptions occurred in classes ForestHealpixReader and Tracer2Reader