CambGrowth¶
- class hmf.core.growth_models.CambGrowth(*, z_max=20.0)[source]¶
The growth of each species from CAMB, at k = 0.01/Mpc.
"cb"is the growth of CAMB’sdelta_nonuand"tot"ofdelta_tot. With massive neutrinos the growth is scale-dependent: at this scale the neutrinos partly cluster, so it differs fromODEGrowth, which is the small-scale limit (by about 2% at z = 10 for a 0.3 eV neutrino).With a
Growthstage whose transfer model isCAMB, the growth comes from the transfer’s run. Otherwise it makes the run ofCAMB(z_max=z_max)at the growth stage’sk_accuracy(which a default CAMB transfer stage with the same accuracy shares).- Parameters:
z_max (float, default 20.0) – The largest redshift of the growth factor.
Attributes
- alias: ClassVar[str | None] = 'CAMB'¶
The short name the model is registered under, if any. Set by the
aliasclass keyword; never inherited.
- backend: ClassVar[str | None] = 'camb'¶
The Boltzmann code that computes the model (
"camb"or"class"), if any.
- calibration¶
Where this model was calibrated, with its source (
Noneif it was not).The class’s
calibration_domain, unless it depends on the instance’s parameters.
- calibration_domain: ClassVar[Domain | None] = None¶
The calibration domain of the class, with its source (
Noneif it was not calibrated): that of its default parameters. Ask an instance forcalibration.
- parameter_source: ClassVar[str] = ''¶
The exact source (paper, version, table or equation) of the parameter defaults, e.g. “Tinker et al. 2008, ApJ 688, 709 (published), Table 2”.
- references: ClassVar[tuple[str, ...]] = ('Lewis, A., Challinor, A., Lasenby, A., 2000. ApJ 538, 473. https://doi.org/10.1086/309179',)¶
References to cite when the model is used, each a formatted citation.
- valid_domain: ClassVar[Domain] = Domain(bounds=(('z', Interval(lower=0.0, upper=inf, unit=None, lower_open=False, upper_open=True)),), source='z >= 0.')¶
z >= 0. The
Growthstage checks z against the model’s class’s domain (so a model can narrow it), and also against the redshifts its solution covers (up toGrowthSolution.z_max, e.g. a table’s largest redshift): growth is never extrapolated.- Type:
Where the model can be evaluated
Methods
- check_cosmology(cosmology: FLRW) None¶
Raise if the Boltzmann code can’t compute
cosmology.- Raises:
ValueError – If
cosmologyis not a LambdaCDM, wCDM or w0waCDM (or a flat one), or does not set the baryon density or the CMB temperature.
- classmethod coerce(value: object) Self¶
Convert a value to a model of this kind: the converter of a model field.
- Parameters:
value – An instance of
cls, which is returned as it is; or a name, import path or class thatget()accepts, which is looked up and instantiated with its default parameters.- Returns:
An instance of
cls.- Return type:
- Raises:
ModelNotFoundError – If
valueis a name that no model of this kind is known by.TypeError – If
valueis of any other type, or names a class that is not a concrete subclass ofcls.
Examples
>>> from hmf.core.filters import Filter, TopHat >>> Filter.coerce("TopHat") == TopHat() True
- classmethod fields_info() tuple[FieldInfo, ...]¶
Describe this class’s fields, without creating an instance.
- Returns:
The name, type, default and documentation of each field.
- Return type:
tuple of FieldInfo
- classmethod get(name: str | type[Model]) type[Self]¶
Look up a model of this kind.
- Parameters:
name – An alias (
"Tinker08"), a qualified name ("hmf.core.fits:Tinker08"), an import path to a class not yet imported ("pkg.mod:Cls"or"pkg.mod.Cls"), or a class.- Returns:
The model class (not an instance). It is always a subclass of
cls.- Return type:
- Raises:
ModelNotFoundError – If no model of this kind is known by
name, even after loading thehmf.modelsentry points and tryingnameas an import path.TypeError – If
nameresolves to something that is not a concrete subclass ofcls.
- classmethod get_aliases() Mapping[str, str]¶
Return a read-only mapping from alias to qualified name, for this kind.
- classmethod get_models() Mapping[str, type[Self]]¶
Return the registered models of this kind, by qualified name.
Plugins advertised in the
hmf.modelsentry-point group are loaded first.- Returns:
A read-only mapping from qualified name to class. Called on a kind, it is a live view of the registry. Called on a non-kind subclass, it holds only the models that subclass it.
- Return type:
Mapping
- solve(cosmology: FLRW, *, run: BoltzmannRun | None = None, disk_cache: DiskCache | None = None, k_accuracy: KAccuracy = KAccuracy(dln_k=0.02, ln_k_min=-18.420680743952367, k_max_r_min=20.0)) GrowthSolution¶
Compute the growth (see
GrowthModel.solve()).- Parameters:
cosmology – As for
GrowthModel.solve().run – As for
GrowthModel.solve().disk_cache – As for
GrowthModel.solve().k_accuracy – As for
GrowthModel.solve().
- Returns:
The growth of every species.
- Return type: