Module for defining different cosmologies

fruitbat.cosmologies.add_cosmology(name, cosmo)[source]

Adds a user created cosmology to the list of available cosmologies.

  • name (str) – The keyword for the new cosmology.
  • cosmo (An instance of astropy.cosmology) – The cosmology to add to the list of available cosmologies.


>>> params = {"H0": 72.4, "Om0": 0.26}
>>> new_cosmology = fruitbat.cosmology.create_cosmology(parameters=params)
>>> fruitbat.add_cosmology("new_cosmology", new_cosmology)

Returns the list constaining all the keywords for valid cosmologies.


Returns a dictionary of the builtin cosmologies with keywords and corresponding instances of those cosmologies.

Returns:cosmologies (dict) – Contains the keywords and instances for each cosmology.

Returns a dictionary containing the valid cosmology keys and the corresponding instance of that cosmology.

fruitbat.cosmologies.create_cosmology(parameters=None, name=None)[source]

A wrapper to create custom astropy cosmologies.

The only available cosmology types in this method are: FlatLambdaCDM, FlatwCDM, LambdaCDM and wCDM.

See astropy for more details on these types of cosmologies. To create a cosmology of a type that isn’t listed above, it will have to be created directly using astropy.cosmology.

  • parameters (dict or None) – A dictionary containing the cosmological parameters. The names of the parameters must conform to the same format as the parameters used in the astropy.cosmology module. If parameters = None then default values for each parameter is used.
  • name (str or None, optional) – The name of the cosmology. Default: None


Default parameter values:

params = {'H0': 70, 'Om0': 0.3, 'Oc0': 0.26, 'Ob0': 0.04,
          'Neff': 3.04, 'flat': True, 'Tcmb0': 0.0,
          'm_nu': 0.0, 'w0': -1}

If 'flat' is set to False then a value of 'Ode0' (current dark energy density) should be specified.


Resets the list of available cosmologies to the default builtin cosmologies.


Planck13 instance of FlatLambdaCDM cosmology

(from Planck Collaboration 2014, A&A, 571, A16 (Paper XVI), Table 5 (Planck + WP + highL + BAO))


Planck15 instance of FlatLambdaCDM cosmology

(from Planck Collaboration 2016, A&A, 594, A13 (Paper XIII), Table 4 (TT, TE, EE + lowP + lensing + ext))


Planck18 instance of FlatLambdaCDM cosmology

(from Planck 2018 results. VI. Cosmological Parameters, A&A, submitted, Table 2 (TT, TE, EE + lowE + lensing + BAO))


WMAP5 instance of FlatLambdaCDM cosmology

(from Komatsu et al. 2009, ApJS, 180, 330, doi: 10.1088/0067-0049/180/2/330. Table 1 (WMAP + BAO + SN ML).)


WMAP7 instance of FlatLambdaCDM cosmology

(from Komatsu et al. 2011, ApJS, 192, 18, doi: 10.1088/0067-0049/192/2/18. Table 1 (WMAP + BAO + H0 ML).)


WMAP9 instance of FlatLambdaCDM cosmology

(from Hinshaw et al. 2013, ApJS, 208, 19, doi: 10.1088/0067-0049/208/2/19. Table 4 (WMAP9 + eCMB + BAO + H0, last column))