py21cmfast.wrapper.inputs.CosmoParams ===================================== .. py:class:: py21cmfast.wrapper.inputs.CosmoParams Bases: :py:obj:`InputStruct` Cosmological parameters. Default parameters are based on `Plank18 `_, Table 2, last column [TT,TE,EE+lowE+lensing+BAO]. :ivar hlittle: The hubble parameter, :math:`H_0/100`. :vartype hlittle: float :ivar OMm: The fractional matter density, :math:`\Omega_m`. This is the sum of the baryon and CDM densities. :vartype OMm: float :ivar OMb: The fraction baryon density, :math:`\Omega_b`. :vartype OMb: float :ivar POWER_INDEX: Spectral index of the power spectrum, :math:`n_s` :vartype POWER_INDEX: float :ivar SIGMA_8: RMS mass variance of the matter field in spheres of 8 Mpc/h (power spectrum normalisation). If not given explicitly but A_s is given, it is auto-calculated via A_s and the other cosmological parameters. Only one of SIGMA_8 and A_s can be given, otherwise an error is raised. If neither is given, it is set to the default value of 0.8102. :vartype SIGMA_8: float :ivar A_s: Amplitude of primordial curvature power spectrum, at :math:`k_{pivot} = 0.05 {\rm Mpc}^{-1}`. If not given explicitly and SIGMA_8 is given, it is auto-calculated via SIGMA_8 and the other cosmological parameters, using CLASS. Only one of SIGMA_8 and A_s can be given, otherwise an error is raised. If neither is given, it is set to the default value of 2.105e-9. :vartype A_s: float :ivar base_cosmo: The base astropy cosmology object to use for this cosmology. You can set this to something other than LambdaCDM if you want to use a different cosmology. Note that the cosmological parameters in ``base_cosmo`` are not used at all---only the cosmography. You almost certainly should not set this to anything other than the default, unless you know what you are doing. :vartype base_cosmo: :class:`astropy.cosmology.FLRW`, optional :ivar OMn: Omega neutrino, the neutrino component. Note that this is not used in any of the calculations in the code, but is just provided for completeness. :vartype OMn: float :ivar OMk: Omega curvature, the curvature component. Note that this is not used in any of the calculations in the code, but is just provided for completeness. :vartype OMk: float :ivar OMr: Omega radiation, the radiation component. Note that this is not used in any of the calculations in the code, but is just provided for completeness. :vartype OMr: float :ivar OMtot: Omega total, the total density. Note that this is not used in any of the calculations and is assumed to be unity (i.e. a flat universe), but is just provided for completeness. :vartype OMtot: float :ivar Y_He: Helium mass fraction. :vartype Y_He: float :ivar wl: Dark energy equation of state parameter. :vartype wl: float .. !! processed by numpydoc !! .. py:method:: asdict() -> dict Return a dict representation of the instance. .. rubric:: Examples This dict is such that doing the following should work, i.e. it can be used exactly to construct a new instance of the same object:: >>> inp = InputStruct(**params) >>> newinp =InputStruct(**inp.asdict()) >>> inp == newinp .. !! processed by numpydoc !! .. py:method:: clone(**kwargs) Make a fresh copy of the instance with arbitrary parameters updated. .. !! processed by numpydoc !! .. py:method:: from_astropy(cosmo: astropy.cosmology.FLRW, **kwargs) :classmethod: Create a CosmoParams object from an astropy cosmology object. Pass SIGMA_8 and POWER_INDEX as kwargs if you want to override the default values. .. !! processed by numpydoc !! .. py:method:: from_subdict(dct: dict[str, Any], safe: bool = True) -> Self :classmethod: Construct an instance of this class from a dictionary. .. !! processed by numpydoc !! .. py:method:: new(x: dict | Self | None = None, **kwargs) :classmethod: Create a new instance of the struct. :Parameters: **x** (*dict | InputStruct | None*) -- Initial values for the struct. If `x` is a dictionary, it should map field names to their corresponding values. If `x` is an instance of this class, its attributes will be used as initial values. If `x` is None, the struct will be initialised with default values. :Other Parameters: * **All other parameters should be passed as if directly to the class constructor** * **(i.e. as parameter names).** .. rubric:: Examples >>> params = SimulationOptions.new({'HII_DIM': 250}) >>> params.HII_DIM 250 >>> params = SimulationOptions.new(params) >>> params.HII_DIM 250 >>> params = SimulationOptions.new() >>> params.HII_DIM 200 >>> params = SimulationOptions.new(HII_DIM=256) >>> params.HII_DIM 256 .. !! processed by numpydoc !! .. py:property:: A_s :type: float Amplitude of primordial curvature power spectrum, at k_pivot = 0.05 Mpc^-1. If not given explicitly, it is auto-calculated via sigma_8 and the other cosmological parameters. .. !! processed by numpydoc !! .. py:attribute:: OMb :type: float .. py:attribute:: OMk :type: float .. py:property:: OMl Omega lambda, dark energy density. .. !! processed by numpydoc !! .. py:attribute:: OMm :type: float .. py:attribute:: OMn :type: float .. py:attribute:: OMr :type: float .. py:attribute:: OMtot :type: float .. py:attribute:: POWER_INDEX :type: float .. py:property:: SIGMA_8 :type: float RMS mass variance (power spectrum normalisation). If not given explicitly, it is auto-calculated via A_s and the other cosmological parameters. .. !! processed by numpydoc !! .. py:attribute:: Y_He :type: float .. py:property:: cdict :type: dict A python dictionary containing the properties of the wrapped C-struct. The memory pointed to by this dictionary is *not* owned by the wrapped C-struct, but is rather just a python dict. However, in contrast to :meth:`asdict`, this method transforms the properties to what they should be in C (e.g. linear space vs. log-space) before putting them into the dict. This dict also contains *only* the properties of the wrapped C-struct, rather than all properties of the :class:`InputStruct` instance (some attributes of the python instance are there only to guide setting of defaults, and don't appear in the C-struct at all). .. !! processed by numpydoc !! .. py:property:: cosmo An astropy cosmology object for this cosmology. .. !! processed by numpydoc !! .. py:attribute:: hlittle :type: float .. py:attribute:: wl :type: float