py21cmfast.inputs.CosmoParams

class py21cmfast.inputs.CosmoParams(*args, **kwargs)[source]

Cosmological parameters (with defaults) which translates to a C struct.

To see default values for each parameter, use CosmoParams._defaults_. All parameters passed in the constructor are also saved as instance attributes which should be considered read-only. This is true of all input-parameter classes.

Default parameters are based on Plank18, https://arxiv.org/pdf/1807.06209.pdf, Table 2, last column. [TT,TE,EE+lowE+lensing+BAO]

Parameters
  • SIGMA_8 (float, optional) – RMS mass variance (power spectrum normalisation).

  • hlittle (float, optional) – The hubble parameter, H_0/100.

  • OMm (float, optional) – Omega matter.

  • OMb (float, optional) – Omega baryon, the baryon component.

  • POWER_INDEX (float, optional) – Spectral index of the power spectrum.

Methods

__init__(*args, **kwargs)

clone(**kwargs)

Make a fresh copy of the instance with arbitrary parameters updated.

convert(key, val)

Make any conversions of values before saving to the instance.

get_fieldnames([cstruct])

Obtain the C-side field names of this struct.

get_fields([cstruct])

Obtain the C-side fields of this struct.

get_pointer_fields([cstruct])

Obtain all pointer fields of the struct (typically simulation boxes).

refresh_cstruct()

Delete the underlying C object, forcing it to be rebuilt.

update(**kwargs)

Update the parameters of an existing class structure.

Attributes

OMl

Omega lambda, dark energy density.

cosmo

Return an astropy cosmology object for this cosmology.

defining_dict

Pure python dictionary representation of this class, as it would appear in C.

fieldnames

List names of fields of the underlying C struct.

fields

List of fields of the underlying C struct (a list of tuples of "name, type").

pointer_fields

List of names of fields which have pointer type in the C struct.

primitive_fields

List of names of fields which have primitive type in the C struct.

pystruct

A pure-python dictionary representation of the corresponding C structure.

self

Dictionary which if passed to its own constructor will yield an identical copy.