Bases: astropy.cosmology.core.Cosmology
A class describing an isotropic and homogeneous (Friedmann-Lemaitre-Robertson-Walker) cosmology.
This is an abstract base class – you can’t instantiate examples of this class, but must work with one of its subclasses such as LambdaCDM or wCDM.
Parameters: | H0 : float or scalar Quantity
Om0 : float
Ode0 : float
Tcmb0 : float or scalar Quantity
Neff : float
m_nu : Quantity
name : str
|
---|
Notes
Class instances are static – you can’t change the values of the parameters. That is, all of the attributes above are read only.
Attributes Summary
H0 | Return the Hubble constant as an Quantity at z=0 |
Neff | Number of effective neutrino species |
Ode0 | Omega dark energy; dark energy density/critical density at z=0 |
Ogamma0 | Omega gamma; the density/critical density of photons at z=0 |
Ok0 | Omega curvature; the effective curvature density/critical density |
Om0 | Omega matter; matter density/critical density at z=0 |
Onu0 | Omega nu; the density/critical density of neutrinos at z=0 |
Tcmb0 | Temperature of the CMB as Quantity at z=0 |
Tnu0 | Temperature of the neutrino background as Quantity at z=0 |
critical_density0 | Critical density as Quantity at z=0 |
h | Dimensionless Hubble constant: h = H_0 / 100 [km/sec/Mpc] |
has_massive_nu | Does this cosmology have at least one massive neutrino species? |
hubble_distance | Hubble distance as Quantity |
hubble_time | Hubble time as Quantity |
m_nu | Mass of neutrino species |
Methods Summary
H(z) | Hubble parameter (km/s/Mpc) at redshift z. |
Ode(z) | Return the density parameter for dark energy at redshift z. |
Ogamma(z) | Return the density parameter for photons at redshift z. |
Ok(z) | Return the equivalent density parameter for curvature at redshift z. |
Om(z) | Return the density parameter for non-relativistic matter at redshift z. |
Onu(z) | Return the density parameter for massless neutrinos at redshift z. |
Tcmb(z) | Return the CMB temperature at redshift z. |
Tnu(z) | Return the neutrino temperature at redshift z. |
absorption_distance(z) | Absorption distance at redshift z. |
age(z) | Age of the universe in Gyr at redshift z. |
angular_diameter_distance(z) | Angular diameter distance in Mpc at a given redshift. |
angular_diameter_distance_z1z2(z1, z2) | Angular diameter distance between objects at 2 redshifts. |
arcsec_per_kpc_comoving(z) | Angular separation in arcsec corresponding to a comoving kpc at redshift z. |
arcsec_per_kpc_proper(z) | Angular separation in arcsec corresponding to a proper kpc at redshift z. |
clone(**kwargs) | Returns a copy of this object, potentially with some changes. |
comoving_distance(z) | Comoving line-of-sight distance in Mpc at a given redshift. |
comoving_transverse_distance(z) | Comoving transverse distance in Mpc at a given redshift. |
comoving_volume(z) | Comoving volume in cubic Mpc at redshift z. |
critical_density(z) | Critical density in grams per cubic cm at redshift z. |
de_density_scale(z) | Evaluates the redshift dependence of the dark energy density. |
differential_comoving_volume(z) | Differential comoving volume at redshift z. |
distmod(z) | Distance modulus at redshift z. |
efunc(z) | Function used to calculate H(z), the Hubble parameter. |
inv_efunc(z) | Inverse of efunc. |
kpc_comoving_per_arcmin(z) | Separation in transverse comoving kpc corresponding to an arcminute at redshift z. |
kpc_proper_per_arcmin(z) | Separation in transverse proper kpc corresponding to an arcminute at redshift z. |
lookback_time(z) | Lookback time in Gyr to redshift z. |
luminosity_distance(z) | Luminosity distance in Mpc at redshift z. |
nu_relative_density(z) | Neutrino density function relative to the energy density in photons. |
scale_factor(z) | Scale factor at redshift z. |
w(z) | The dark energy equation of state. |
Attributes Documentation
Number of effective neutrino species
Omega dark energy; dark energy density/critical density at z=0
Omega gamma; the density/critical density of photons at z=0
Omega curvature; the effective curvature density/critical density at z=0
Omega matter; matter density/critical density at z=0
Omega nu; the density/critical density of neutrinos at z=0
Dimensionless Hubble constant: h = H_0 / 100 [km/sec/Mpc]
Does this cosmology have at least one massive neutrino species?
Mass of neutrino species
Methods Documentation
Hubble parameter (km/s/Mpc) at redshift z.
Parameters: | z : array_like
|
---|---|
Returns: | H : Quantity
|
Return the density parameter for dark energy at redshift z.
Parameters: | z : array_like
|
---|---|
Returns: | Ode : ndarray, or float if input scalar
|
Return the density parameter for photons at redshift z.
Parameters: | z : array_like
|
---|---|
Returns: | Ogamma : ndarray, or float if input scalar
|
Return the equivalent density parameter for curvature at redshift z.
Parameters: | z : array_like
|
---|---|
Returns: | Ok : ndarray, or float if input scalar
|
Return the density parameter for non-relativistic matter at redshift z.
Parameters: | z : array_like
|
---|---|
Returns: | Om : ndarray, or float if input scalar
|
Return the density parameter for massless neutrinos at redshift z.
Parameters: | z : array_like
|
---|---|
Returns: | Onu : ndarray, or float if input scalar
|
Return the CMB temperature at redshift z.
Parameters: | z : array_like
|
---|---|
Returns: | Tcmb : Quantity
|
Return the neutrino temperature at redshift z.
Parameters: | z : array_like
|
---|---|
Returns: | Tnu : Quantity
|
Absorption distance at redshift z.
This is used to calculate the number of objects with some cross section of absorption and number density intersecting a sightline per unit redshift path.
Parameters: | z : array_like
|
---|---|
Returns: | d : float or ndarray
|
References
Hogg 1999 Section 11. (astro-ph/9905116) Bahcall, John N. and Peebles, P.J.E. 1969, ApJ, 156L, 7B
Age of the universe in Gyr at redshift z.
Parameters: | z : array_like
|
---|---|
Returns: | t : Quantity
|
See also
Angular diameter distance in Mpc at a given redshift.
This gives the proper (sometimes called ‘physical’) transverse distance corresponding to an angle of 1 radian for an object at redshift z.
Weinberg, 1972, pp 421-424; Weedman, 1986, pp 65-67; Peebles, 1993, pp 325-327.
Parameters: | z : array_like
|
---|---|
Returns: | d : Quantity
|
Angular diameter distance between objects at 2 redshifts. Useful for gravitational lensing.
Parameters: | z1, z2 : array_like, shape (N,)
|
---|---|
Returns: | d : Quantity, shape (N,) or single if input scalar
|
Raises: | CosmologyError
|
Notes
This method only works for flat or open curvature (omega_k >= 0).
Angular separation in arcsec corresponding to a comoving kpc at redshift z.
Parameters: | z : array_like
|
---|---|
Returns: | theta : Quantity
|
Angular separation in arcsec corresponding to a proper kpc at redshift z.
Parameters: | z : array_like
|
---|---|
Returns: | theta : Quantity
|
Returns a copy of this object, potentially with some changes.
Returns: | newcos : Subclass of FLRW A new instance of this class with the specified changes. |
---|
Notes
This assumes that the values of all constructor arguments are available as properties, which is true of all the provided subclasses but may not be true of user-provided ones. You can’t change the type of class, so this can’t be used to change between flat and non-flat. If no modifications are requested, then a reference to this object is returned.
Examples
To make a copy of the Planck13 cosmology with a different Omega_m and a new name:
>>> from astropy.cosmology import Planck13
>>> newcos = Planck13.clone(name="Modified Planck 2013", Om0=0.35)
Comoving line-of-sight distance in Mpc at a given redshift.
The comoving distance along the line-of-sight between two objects remains constant with time for objects in the Hubble flow.
Parameters: | z : array_like
|
---|---|
Returns: | d : ndarray, or float if input scalar
|
Comoving transverse distance in Mpc at a given redshift.
This value is the transverse comoving distance at redshift z corresponding to an angular separation of 1 radian. This is the same as the comoving distance if omega_k is zero (as in the current concordance lambda CDM model).
Parameters: | z : array_like
|
---|---|
Returns: | d : Quantity
|
Notes
This quantity also called the ‘proper motion distance’ in some texts.
Comoving volume in cubic Mpc at redshift z.
This is the volume of the universe encompassed by redshifts less than z. For the case of omega_k = 0 it is a sphere of radius comoving_distance but it is less intuitive if omega_k is not 0.
Parameters: | z : array_like
|
---|---|
Returns: | V : Quantity
|
Critical density in grams per cubic cm at redshift z.
Parameters: | z : array_like
|
---|---|
Returns: | rho : Quantity
|
Evaluates the redshift dependence of the dark energy density.
Parameters: | z : array_like
|
---|---|
Returns: | I : ndarray, or float if input scalar
|
Notes
The scaling factor, I, is defined by , and is given by
It will generally helpful for subclasses to overload this method if the integral can be done analytically for the particular dark energy equation of state that they implement.
Differential comoving volume at redshift z.
Useful for calculating the effective comoving volume. For example, allows for integration over a comoving volume that has a sensitivity function that changes with redshift. The total comoving volume is given by integrating differential_comoving_volume to redshift z and multiplying by a solid angle.
Parameters: | z : array_like
|
---|---|
Returns: | dV : Quantity
|
Distance modulus at redshift z.
The distance modulus is defined as the (apparent magnitude - absolute magnitude) for an object at redshift z.
Parameters: | z : array_like
|
---|---|
Returns: | distmod : Quantity
|
See also
Function used to calculate H(z), the Hubble parameter.
Parameters: | z : array_like
|
---|---|
Returns: | E : ndarray, or float if input scalar
|
Notes
The return value, E, is defined such that .
It is not necessary to override this method, but if de_density_scale takes a particularly simple form, it may be advantageous to.
Inverse of efunc.
Parameters: | z : array_like
|
---|---|
Returns: | E : ndarray, or float if input scalar
|
Separation in transverse comoving kpc corresponding to an arcminute at redshift z.
Parameters: | z : array_like
|
---|---|
Returns: | d : Quantity
|
Separation in transverse proper kpc corresponding to an arcminute at redshift z.
Parameters: | z : array_like
|
---|---|
Returns: | d : Quantity
|
Lookback time in Gyr to redshift z.
The lookback time is the difference between the age of the Universe now and the age at redshift z.
Parameters: | z : array_like
|
---|---|
Returns: | t : Quantity
|
See also
Luminosity distance in Mpc at redshift z.
This is the distance to use when converting between the bolometric flux from an object at redshift z and its bolometric luminosity.
Parameters: | z : array_like
|
---|---|
Returns: | d : Quantity
|
See also
References
Weinberg, 1972, pp 420-424; Weedman, 1986, pp 60-62.
Neutrino density function relative to the energy density in photons.
Parameters: | z : array like
|
---|---|
Returns: | f : ndarray, or float if z is scalar
|
Notes
The density in neutrinos is given by
where
assuming that all neutrino species have the same mass. If they have different masses, a similar term is calculated for each one. Note that f has the asymptotic behavior . This method returns using an analytical fitting formula given in Komatsu et al. 2011, ApJS 192, 18.
Scale factor at redshift z.
The scale factor is defined as .
Parameters: | z : array_like
|
---|---|
Returns: | a : ndarray, or float if input scalar
|
The dark energy equation of state.
Parameters: | z : array_like
|
---|---|
Returns: | w : ndarray, or float if input scalar
|
Notes
The dark energy equation of state is defined as , where is the pressure at redshift z and is the density at redshift z, both in units where c=1.
This must be overridden by subclasses.