grale.cosmology

With this module you can calculate angular diameter distances for a specific cosmology. Inversely, if you know the angular diameter distance to an object, you can try to reconstruct the redshifts that are compatible with it.

grale.cosmology.setDefaultCosmology(x)

Sets the default cosmological model to x, which should be an instance of Cosmology.

grale.cosmology.getDefaultCosmology()

Returns the default cosmological model that has been set using setDefaultCosmology().

exception grale.cosmology.CosmologyException

An exception that will be raised in case something goes wrong in the cosmology calculations.

class grale.cosmology.Cosmology(h, Omega_m, Omega_r, Omega_v, w=-1.0)

Specifies the cosmology parameters for which angular diameter distances will be calculated.

__init__(h, Omega_m, Omega_r, Omega_v, w=-1.0)

Parameters are:

  • h: specifies the hubble constant \(H_0\) as \(h \times 100 \; \rm{km}\; \rm{s}^{-1} \rm{Mpc}^{-1}\)

  • Omega_m: matter density parameter \(\Omega_m\)

  • Omega_r: radiation density parameter \(\Omega_r\)

  • Omega_v: vacuum density parameter \(\Omega_v\)

  • w: specifies the equation of state of the vacuum energy as \(p = w \times \rho\)

findRedshiftForAngularDiameterDistance(Dtarget, zref=0, zmax=20)

This function attempts to find the redshift(s) that correspond to the angular diameter distance Dtarget.

Parameters are:

  • Dtarget: the angular diameter distance for which the possible redshifts should be searched.

  • zref: in case the angular diameter distance should be calculated with respect to a specific redshift, this redshift can be specified here.

  • zmax: the algorithm will look for redshifts that are smaller than this value.

getAngularDiameterDistance(z1, z2=None)

Returns the angular diameter distance between two redshifts, or if only one redshift is specified, between redshift 0 and the specified one. The returned distance is specified in meters, but can be converted using the constants in grale.constants.

getParameters()

Returns a dictionary that contains the model parameters that were specified in the constructor.