TransferWDM¶
- class hmf.alternatives.wdm.TransferWDM(*args, **kwargs)[source]¶
A subclass of
hmf.transfer.Transferthat mixes in WDM capabilities.This replaces the standard CDM quantities with WDM-derived ones, where relevant.
In addition to the parameters directly passed to this class, others are available which are passed on to its superclass. To read a standard documented list of (all) parameters, use
parameter_info(). If you want to just see the plain list of available parameters, use :meth`get_all_parameters`. To see the actual defaults for each parameter, useget_all_parameter_defaults().Attributes
- cosmo¶
The cosmography object with custom parameters applied.
A
astropy.cosmology.FLRWinstance with custom cosmology fromcosmo_paramsapplied.
- cosmo_model¶
The cosmological model instance.
Basis for the cosmology with custom subclasses supported. Defaults to Planck18. See astropy documentation for details.
- Type:
instance of astropy.cosmology.FLRW subclass
- Type:
Parameter
- cosmo_params¶
Parameters deviating from the base cosmology.
Useful for repeated updates of a single parameter, leaving others the same. Default is the empty dict. Parameters passed must match the allowed parameters of cosmo_model. For the basic class, these are:
- Tcmb0:
Temperature of the CMB at z=0
- Neff:
Number of massless neutrino species
- M_nu:
Mass of neutrino species (list)
- H0:
The hubble constant at z=0
- Om0:
The normalised matter density at z=0
- Type:
- Type:
Parameter
- delta_k¶
Dimensionless power spectrum, \(\Delta_k = \frac{k^3 P(k)}{2\pi^2}\).
- growth¶
The instantiated growth model.
- growth_factor¶
The growth factor.
- growth_model¶
The model to use to calculate the growth function/growth rate.
"ClassGrowth"needs the optionalclassypackage (pip install hmf[class]).- Type:
hmf.growth_factor.BaseGrowthFactor subclass
- Type:
Parameter
- growth_params¶
Relevant parameters of the
growth_model.- Type:
- Type:
Parameter
- k¶
Wavenumbers, [h/Mpc].
- mean_density0¶
Mean density of universe at z=0, [Msun h^2 / Mpc**3].
- n¶
Spectral index of fluctuations.
Must be greater than -3 and less than 4.
- Type:
- Type:
Parameter
- nonlinear_delta_k¶
Dimensionless nonlinear power spectrum.
\[\Delta_k = \frac{k^3 P_{\rm nl}(k)}{2\pi^2}\]Non-linear corrections come from HALOFIT.
If you use this, please cite HALOFIT: Smith et al. [1], and also Takahashi et al. [2] when
takahashiis True (the default).References
- nonlinear_power¶
Non-linear log power [units \(Mpc^3/h^3\)].
Non-linear corrections come from HALOFIT.
If you use this, please cite HALOFIT: Smith et al. [1], and also Takahashi et al. [2] when
takahashiis True (the default).References
- parameter_values¶
Dictionary of all parameters and their current values.
- power¶
Normalised log power spectrum [units \(Mpc^3/h^3\)].
- references: ClassVar[tuple[str, ...]] = ()¶
References for the framework itself (not its component models), each a formatted citation string. References of parent framework classes are included too.
- sigma_8_species¶
"tot","cb"orNone.The default,
"tot", meanssigma_8is the r.m.s. of the total matter field (including massive neutrinos), which is how experiments such as Planck quote it, and how the defaultsigma_8is defined. When the transfer model computes the CDM+baryon field (matter_species="cb", the default), its power spectrum is normalised so that the total matter field from the same model has r.m.s.sigma_8."cb"meanssigma_8is that of the CDM+baryon field, andNonemeans whichever field the transfer model computes.This has no effect with massless neutrinos (the fields are then identical) or for transfer models that don’t distinguish the two fields (i.e. have no
matter_speciesparameter, likeEHorBBKS). Otherwise, normalising a field other than the computed one needs that field’s transfer function too. WithCAMBorCLASSthis reuses the same run, which gives both fields. See Massive neutrinos: which matter field to use.
- takahashi¶
Whether to use updated HALOFIT coefficients from Takahashi+12.
If False, use the original coefficients from Smith+2003.
- Type:
- Type:
Parameter
- transfer¶
The instantiated transfer model.
- transfer_function¶
Normalised CDM log transfer function.
- transfer_model¶
Defines which transfer function model to use.
Built-in available models are found in the
hmf.transfer_modelsmodule. Default is CAMB if installed, otherwise EH."CLASS"needs the optionalclassypackage (pip install hmf[class]).- Type:
str or
hmf.transfer_models.TransferComponentsubclass, optional- Type:
Parameter
- wdm¶
The instantiated WDM model.
Contains quantities relevant to WDM.
- wdm_model¶
A model for the WDM effect on the transfer function.
- Type:
str or
WDMsubclass- Type:
Parameter
Methods
- clone(**kwargs)¶
Create and return an updated clone of the current object.
- get_acknowledgments(flat: bool = False) dict[str, tuple[str, ...]] | list[str]¶
Get the references to cite for the current setup of the framework.
The references are grouped by where they come from, in this order:
"hmf": the paper describing hmf itself.The framework’s class name (e.g.
"MassFunction"): the framework’s ownreferences, including those of its parent framework classes. Only present if there are any.Each
*_modelparameter (e.g."hmf_model","transfer_model"): the references of the model currently set on it. A model with nothing to cite gives an empty tuple; a parameter set toNoneis left out.Each sub-framework, with its keys prefixed by the sub-framework’s name (e.g.
"tracer.transfer_model").
The keys say which model each citation belongs to, not whether that model was used in a quantity you computed. All references are read from the model classes, so this does not compute anything.
- Parameters:
flat – If True, return a single list of all the references with duplicates removed (keeping the first occurrence), e.g. for a paper’s bibliography.
- Returns:
A dict mapping each source to a tuple of formatted citations, or a flat list of citations if
flatis True.- Return type:
Examples
>>> from hmf import MassFunction >>> mf = MassFunction(hmf_model="Tinker08") >>> by_model = mf.get_acknowledgments() >>> bibliography = mf.get_acknowledgments(flat=True)
- classmethod get_all_parameter_defaults(recursive=True)¶
Dictionary of all parameters and defaults.
Defaults may be set with some logic in
__init__, so they are read from an instance. The instance is not validated, so no quantities are computed.
- classmethod get_all_parameter_names() list[str]¶
Return all parameter names in the class.
These are read from the class’s
@parameterdefinitions, so the class is not instantiated.
- get_dependencies(*q)¶
Determine all parameter dependencies of the quantities in q.
- classmethod parameter_info(names=None)¶
Prints information about each parameter in the class.
Optionally, restrict printed parameters to those found in the list of names provided.
- classmethod quantities_available() list[str]¶
Obtain a list of all available (public) output quantities.
These are the class’s
@cached_quantityand@subframeworkdefinitions, read without instantiating the class.
- update(**kwargs)¶
Update parameters of the framework with kwargs.
The update is atomic: if setting any parameter, or the validation of the new set of parameters, fails, all parameters are restored to their values from before the call, and the error is re-raised.
- Parameters:
**kwargs – New values of parameters of the framework. A key
<name>_params, where<name>is a sub-framework, takes a dict of parameters with which to update that sub-framework.- Raises:
ValueError – If a key is not a parameter of the framework (or a sub-framework’s
_params), or if the new parameters fail validation.
- validate()¶
Perform validation of the input parameters as they relate to each other.