firecrown.models.two_point

TwoPoint theory support.

Classes

ApplyInterpolationWhen

Flags controlling when to apply interpolation of multipole moments.

TwoPointTheory

Making predictions for TwoPoint statistics.

Functions

at_least_one_tracer_has_hm(tools, tracer0, tracer1)

Compute a power spectrum with the halo model.

at_least_one_tracer_has_pt(tools, tracer0, tracer1)

Compute the power spectrum with the perturbation theory.

calculate_pk(pk_name, tools, tracer0, tracer1)

Return the power spectrum named by pk_name.

determine_ccl_kind(sacc_data_type)

Determine the CCL kind for this SACC data type.

Package Contents

class firecrown.models.two_point.ApplyInterpolationWhen

Bases: enum.Flag

Inheritance diagram of firecrown.models.two_point.ApplyInterpolationWhen

Flags controlling when to apply interpolation of multipole moments.

These flags specify the contexts in which interpolation should be used instead of computing all multipoles exactly. When NONE is set, all multipoles are computed directly. When any flag is set, only the multipoles defined in LogLinearElls() are computed exactly; the others will be interpolated.

Note: For real-space correlation functions xi(theta), interpolation is handled internally by CCL and does not depend on these flags.

NONE = 0
REAL
HARMONIC
HARMONIC_WINDOW
DEFAULT
ALL
classmethod __get_pydantic_core_schema__(_source_type, _handler)

Custom schema for Pydantic to support Flag (de)serialization from string.

Parameters:
  • _source_type (Any)

  • _handler (pydantic.GetCoreSchemaHandler)

Return type:

pydantic_core.core_schema.CoreSchema

firecrown.models.two_point.at_least_one_tracer_has_hm(tools, tracer0, tracer1)

Compute a power spectrum with the halo model.

Parameters:
Returns:

The power spectrum.

Return type:

pyccl.Pk2D

firecrown.models.two_point.at_least_one_tracer_has_pt(tools, tracer0, tracer1)

Compute the power spectrum with the perturbation theory.

If one of the tracers does not have a perturbation theory (PT) tracer, a dummy matter PT tracer is created for it. This is useful for doing cross-correlations between a PT tracer and a non-PT tracer.

Parameters:
Returns:

The power spectrum.

Return type:

pyccl.Pk2D

firecrown.models.two_point.calculate_pk(pk_name, tools, tracer0, tracer1)

Return the power spectrum named by pk_name.

If the modeling tools already has the power spectrum, it is returned. If not, is is computed with the help of the modeling tools.

Parameters:
Returns:

The power spectrum.

Return type:

pyccl.Pk2D

firecrown.models.two_point.determine_ccl_kind(sacc_data_type)

Determine the CCL kind for this SACC data type.

Parameters:

sacc_data_type (str) – the name of the SACC data type

Returns:

the CCL kind

Return type:

str

class firecrown.models.two_point.TwoPointTheory(*, sacc_data_type, sources, interp_ells_gen=LogLinearElls(), ell_or_theta=None, tracers=None, int_options=None, apply_interp=ApplyInterpolationWhen.DEFAULT)

Bases: firecrown.updatable.Updatable

Inheritance diagram of firecrown.models.two_point.TwoPointTheory

Making predictions for TwoPoint statistics.

Parameters:
sacc_data_type
ccl_kind = 'cl'
sources
interp_ells_gen
ell_or_theta_config: None | firecrown.generators.two_point.EllOrThetaConfig = None
window: None | numpy.typing.NDArray[numpy.float64] = None
sacc_tracers = None
ells: None | numpy.typing.NDArray[numpy.int64] = None
thetas: None | numpy.typing.NDArray[numpy.float64] = None
mean_ells: None | numpy.typing.NDArray[numpy.float64] = None
cells: dict[firecrown.metadata_types.TracerNames, numpy.typing.NDArray[numpy.float64]]
ells_for_xi: numpy.typing.NDArray[numpy.int64]
int_options = None
apply_interp
property source0: firecrown.likelihood.source.Source

Return the first source.

Return type:

firecrown.likelihood.source.Source

property source1: firecrown.likelihood.source.Source

Return the second source.

Return type:

firecrown.likelihood.source.Source

initialize_sources(sacc_data)

Initialize this TwoPointTheory’s sources and tracer names.

Parameters:

sacc_data (sacc.Sacc) – The data in the from which we read the data.

Returns:

The tracer names.

Return type:

None

get_tracers_and_scales(tools)

Get tracers and scales for both sources.

Parameters:

tools (firecrown.modeling_tools.ModelingTools) – The modeling tools to use.

Result:

The tracers and scales for both sources.

Return type:

tuple[collections.abc.Sequence[firecrown.likelihood.source.Tracer], float, collections.abc.Sequence[firecrown.likelihood.source.Tracer], float]

generate_ells_for_interpolation()

Generate ells for interpolation.