firecrown.ccl_factory
This module contains the CCLFactory class and it supporting classes.
The CCLFactory class is a factory class that creates instances of the pyccl.Cosmology class.
Attributes
Classes
This class defines the two-point correlation space. |
|
This class defines the CCL instance creation mode. |
|
Model for the mu-sigma modified gravity model. |
|
Extra parameters for CAMB. |
|
Params to control CCL spline interpolation. |
|
Factory class for creating instances of the pyccl.Cosmology class. |
Module Contents
- firecrown.ccl_factory.PowerSpec
- firecrown.ccl_factory.Background
- firecrown.ccl_factory.CCLCalculatorArgs
- class firecrown.ccl_factory.PoweSpecAmplitudeParameter[source]
Bases:
firecrown.utils.YAMLSerializable,str,enum.Enum
This class defines the two-point correlation space.
The two-point correlation space can be either real or harmonic. The real space corresponds measurements in terms of angular separation, while the harmonic space corresponds to measurements in terms of spherical harmonics decomposition.
- AS
- SIGMA8
- class firecrown.ccl_factory.CCLCreationMode[source]
Bases:
firecrown.utils.YAMLSerializable,str,enum.Enum
This class defines the CCL instance creation mode.
The DEFAULT mode represents the current CCL behavior. It will use CCL’s calculator mode if prepare is called with a CCLCalculatorArgs object. Otherwise, it will use the default CCL mode.
The MU_SIGMA_ISITGR mode enables the mu-sigma modified gravity model with the ISiTGR transfer function, it is not compatible with the Calculator mode.
The PURE_CCL_MODE mode will create a CCL instance with the default parameters. It is not compatible with the Calculator mode.
- DEFAULT
- MU_SIGMA_ISITGR
- PURE_CCL_MODE
- class firecrown.ccl_factory.MuSigmaModel[source]
Bases:
firecrown.updatable.Updatable
Model for the mu-sigma modified gravity model.
- mu
- sigma
- c1
- c2
- lambda0
- class firecrown.ccl_factory.CAMBExtraParams(/, **data)[source]
Bases:
pydantic.BaseModel
Extra parameters for CAMB.
- Parameters:
data (Any)
- model_config
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- halofit_version: Annotated[str | None, Field(frozen=True)] = None
- HMCode_A_baryon: Annotated[float | None, Field(frozen=True)] = None
- HMCode_eta_baryon: Annotated[float | None, Field(frozen=True)] = None
- HMCode_logT_AGN: Annotated[float | None, Field(frozen=True)] = None
- kmax: Annotated[float | None, Field(frozen=True)] = None
- lmax: Annotated[int | None, Field(frozen=True)] = None
- dark_energy_model: Annotated[str | None, Field(frozen=True)] = None
- class firecrown.ccl_factory.CCLSplineParams(/, **data)[source]
Bases:
pydantic.BaseModel
Params to control CCL spline interpolation.
- Parameters:
data (Any)
- model_config
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- a_spline_na: Annotated[int | None, Field(frozen=True)] = None
- a_spline_min: Annotated[float | None, Field(frozen=True)] = None
- a_spline_minlog_pk: Annotated[float | None, Field(frozen=True)] = None
- a_spline_min_pk: Annotated[float | None, Field(frozen=True)] = None
- a_spline_minlog_sm: Annotated[float | None, Field(frozen=True)] = None
- a_spline_min_sm: Annotated[float | None, Field(frozen=True)] = None
- a_spline_minlog: Annotated[float | None, Field(frozen=True)] = None
- a_spline_nlog: Annotated[int | None, Field(frozen=True)] = None
- logm_spline_delta: Annotated[float | None, Field(frozen=True)] = None
- logm_spline_nm: Annotated[int | None, Field(frozen=True)] = None
- logm_spline_min: Annotated[float | None, Field(frozen=True)] = None
- logm_spline_max: Annotated[float | None, Field(frozen=True)] = None
- a_spline_na_sm: Annotated[int | None, Field(frozen=True)] = None
- a_spline_nlog_sm: Annotated[int | None, Field(frozen=True)] = None
- a_spline_na_pk: Annotated[int | None, Field(frozen=True)] = None
- a_spline_nlog_pk: Annotated[int | None, Field(frozen=True)] = None
- k_max_spline: Annotated[float | None, Field(frozen=True)] = None
- k_max: Annotated[float | None, Field(frozen=True)] = None
- k_min: Annotated[float | None, Field(frozen=True)] = None
- dlogk_integration: Annotated[float | None, Field(frozen=True)] = None
- dchi_integration: Annotated[float | None, Field(frozen=True)] = None
- n_k: Annotated[int | None, Field(frozen=True)] = None
- n_k_3dcor: Annotated[int | None, Field(frozen=True)] = None
- ell_min_corr: Annotated[float | None, Field(frozen=True)] = None
- ell_max_corr: Annotated[float | None, Field(frozen=True)] = None
- n_ell_corr: Annotated[int | None, Field(frozen=True)] = None
- __enter__()[source]
Enter the context manager.
This method saves the current CCL global spline parameters, updates them with the values from this CCLSplineParams instance, and returns the instance itself. This allows for temporary modification of CCL spline parameters using a with statement.
- Returns:
The current instance with updated spline parameters.
- Return type:
- __exit__(exc_type, exc_value, traceback)[source]
Exit the context manager.
This method resets the CCL global spline parameters to their original values, as saved when entering the context manager. It ensures that any temporary modifications made to the CCL spline parameters within a with statement are reverted upon exit.
- Parameters:
exc_type – The exception type, if an exception occurred.
exc_value – The exception value, if an exception occurred.
traceback – The traceback object, if an exception occurred.
- class firecrown.ccl_factory.CCLFactory(**data)[source]
Bases:
firecrown.updatable.Updatable,pydantic.BaseModel
Factory class for creating instances of the pyccl.Cosmology class.
- model_config
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- require_nonlinear_pk: Annotated[bool, Field(frozen=True)] = False
- amplitude_parameter: Annotated[PoweSpecAmplitudeParameter, BeforeValidator(_validate_amplitude_parameter), Field(frozen=True)]
- mass_split: Annotated[pyccl.neutrinos.NeutrinoMassSplits, BeforeValidator(_validate_neutrino_mass_splits), Field(frozen=True)]
- creation_mode: Annotated[CCLCreationMode, BeforeValidator(_validate_ccl_creation_mode), Field(frozen=True)]
- camb_extra_params: Annotated[CAMBExtraParams | None, Field(frozen=True)] = None
- ccl_spline_params: Annotated[CCLSplineParams | None, Field(frozen=True)] = None
- Omega_c
- Omega_b
- h
- n_s
- Omega_k
- Neff
- m_nu
- w0
- wa
- T_CMB
- serialize_model(nxt, _)[source]
Serialize the CCLFactory object.
- Parameters:
nxt (pydantic.SerializerFunctionWrapHandler)
_ (pydantic.SerializationInfo)
- classmethod serialize_amplitude_parameter(value)[source]
Serialize the amplitude parameter.
- Parameters:
value (PoweSpecAmplitudeParameter)
- Return type:
str
- classmethod serialize_mass_split(value)[source]
Serialize the mass split parameter.
- Parameters:
value (pyccl.neutrinos.NeutrinoMassSplits)
- Return type:
str
- classmethod serialize_creation_mode(value)[source]
Serialize the creation mode parameter.
- Parameters:
value (CCLCreationMode)
- Return type:
str