firecrown.models.two_point
TwoPoint theory support.
Classes
Flags controlling when to apply interpolation of multipole moments. |
|
Making predictions for TwoPoint statistics. |
Functions
|
Compute a power spectrum with the halo model. |
|
Compute the power spectrum with the perturbation theory. |
|
Return the power spectrum named by pk_name. |
|
Determine the CCL kind for this SACC data type. |
Package Contents
- class firecrown.models.two_point.ApplyInterpolationWhen
Bases:
enum.Flag
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:
tools (firecrown.modeling_tools.ModelingTools) – The modeling tools to use.
tracer0 (firecrown.likelihood.source.Tracer) – The first tracer to use.
tracer1 (firecrown.likelihood.source.Tracer) – The second tracer to use.
- 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:
tools (firecrown.modeling_tools.ModelingTools) – The modeling tools to use.
tracer0 (firecrown.likelihood.source.Tracer) – The first tracer to use.
tracer1 (firecrown.likelihood.source.Tracer) – The second tracer to use.
- 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:
pk_name (str) – The name of the power spectrum to return.
tools (firecrown.modeling_tools.ModelingTools) – The modeling tools to use.
tracer0 (firecrown.likelihood.source.Tracer) – The first tracer to use.
tracer1 (firecrown.likelihood.source.Tracer) – The second tracer to use.
- 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
Making predictions for TwoPoint statistics.
- Parameters:
sacc_data_type (str)
sources (tuple[firecrown.likelihood.source.Source, firecrown.likelihood.source.Source])
interp_ells_gen (firecrown.generators.two_point.LogLinearElls)
ell_or_theta (None | firecrown.generators.two_point.EllOrThetaConfig)
tracers (None | firecrown.metadata_types.TracerNames)
int_options (firecrown.utils.ClIntegrationOptions | None)
apply_interp (firecrown.models.two_point._interpolation.ApplyInterpolationWhen)
- 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:
- property source1: firecrown.likelihood.source.Source
Return the second source.
- Return type:
- 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.