Return the density parameter for neutrinos at redshift z.
Parameters:
z (Quantity-like ['redshift'], array-like) –
Input redshift.
Changed in version 7.0: Passing z as a keyword argument is deprecated.
Returns:
Onu – The energy density of neutrinos relative to the critical density at
each redshift. Note that this includes their kinetic energy (if
they have mass), so it is not equal to the commonly used
\(\sum \frac{m_{\nu}}{94 eV}\), which does not include
kinetic energy.
Returns float if the input is scalar.
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 [1]_.
Parameters:
z (Quantity-like ['redshift'], array-like, positional-only) – Input redshift.
Returns:
X – Absorption distance (dimensionless) at each input redshift.
Returns float if input scalar, ~numpy.ndarray otherwise.
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 ([1]_, [2], [3]).
Parameters:
z (Quantity-like ['redshift'], array-like) –
Input redshift.
Changed in version 7.0: Passing z as a keyword argument is deprecated.
Returns:
d – Angular diameter distance in Mpc at each input redshift.
Angular diameter distance between objects at 2 redshifts.
Useful for gravitational lensing, for example computing the angular
diameter distance between a lensed galaxy and the foreground lens.
Parameters:
z1 (Quantity-like ['redshift'], array-like) – Input redshifts. For most practical applications such as
gravitational lensing, z2 should be larger than z1. The
method will work for z2<z1; however, this will return
negative distances.
z2 (Quantity-like ['redshift'], array-like) – Input redshifts. For most practical applications such as
gravitational lensing, z2 should be larger than z1. The
method will work for z2<z1; however, this will return
negative distances.
Returns:
d – The angular diameter distance between each input redshift pair.
Returns scalar if input is scalar, array else-wise.
Returns a copy of this object with updated parameters, as specified.
This cannot be used to change the type of the cosmology, except for
changing to the non-flat version of this cosmology.
Parameters:
meta (mapping or None (optional, keyword-only)) – Metadata that will update the current metadata.
to_nonflat (bool, optional keyword-only) – Whether to change to the non-flat version of this cosmology.
**kwargs – Cosmology parameter (and name) modifications. If any parameter is
changed and a new name is not given, the name will be set to “[old
name] (modified)”.
Returns:
newcosmo – A new instance of this class with updated parameters as specified.
If no arguments are given, then a reference to this object is
returned instead of copy.
Return type:
~astropy.cosmology.Cosmology subclass instance
Examples
To make a copy of the Planck13 cosmology with a different matter
density (Om0), and a new name:
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 (Quantity-like ['redshift'], array-like) –
Input redshift.
Changed in version 7.0: Passing z as a keyword argument is deprecated.
Returns:
d – Comoving transverse distance in Mpc at each input redshift.
Return type:
Quantity [‘length’]
Notes
This quantity is also called the ‘proper motion distance’ in some texts.
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.
Parameters:
z (Quantity-like ['redshift'], array-like) –
Input redshift.
Changed in version 7.0: Passing z as a keyword argument is deprecated.
Returns:
V – Comoving volume in \(Mpc^3\) at each input redshift.
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 (Quantity-like ['redshift'], array-like) –
Input redshift.
Changed in version 7.0: Passing z as a keyword argument is deprecated.
Returns:
dV – Differential comoving volume per redshift per steradian at each
input redshift.
Two cosmologies may be equivalent even if not the same class.
For example, an instance of LambdaCDM might have \(\Omega_0=1\)
and \(\Omega_k=0\) and therefore be flat, like FlatLambdaCDM.
Parameters:
other (~astropy.cosmology.Cosmology subclass instance, positional-only) – The object to which to compare.
format (bool or None or str, optional keyword-only) – Whether to allow, before equivalence is checked, the object to be
converted to a |Cosmology|. This allows, e.g. a |Table| to be
equivalent to a Cosmology.
False (default) will not allow conversion. True or None will,
and will use the auto-identification to try to infer the correct
format. A str is assumed to be the correct format to use when
converting.
format is broadcast to match the shape of other.
Note that the cosmology arguments are not broadcast against
format, so it cannot determine the output shape.
Returns:
True if cosmologies are equivalent, False otherwise.
Return type:
bool
Examples
Two cosmologies may be equivalent even if not of the same class.
In this examples the LambdaCDM has Ode0 set to the same value
calculated in FlatLambdaCDM.
The list of valid formats, e.g. the |Table| in this example, may be
checked with Cosmology.from_format.list_formats().
As can be seen in the list of formats, not all formats can be
auto-identified by Cosmology.from_format.registry. Objects of
these kinds can still be checked for equivalence, but the correct
format string must be used.
The lookback distance is the light travel time distance to a given redshift.
It is simply c * lookback_time. It may be used to calculate
the proper distance between two redshifts, e.g. for the mean free path
to ionizing radiation.
Parameters:
z (Quantity-like ['redshift'], array-like) –
Input redshift.
Changed in version 7.0: Passing z as a keyword argument is deprecated.
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 \(f(0) = 1\). This
method returns \(0.2271 f\) using an analytical fitting formula
given in Komatsu et al. 2011, ApJS 192, 18.
If accessed from the class, this returns a mapping of the Parameter
objects themselves. If accessed from an instance, this returns a
mapping of the values of the Parameters.
The scale factor is defined as \(a = \frac{a_0}{1 + z}\). The common
convention is to set \(a_0 = 1\). However, in some cases, e.g. in
some old CMB papers, \(a_0\) is used to normalize a to be a
convenient number at the redshift of interest for that paper. Explicitly
using \(a_0\) in both calculation and code avoids ambiguity.
Returns dark energy equation of state at redshift z.
Parameters:
z (Quantity-like ['redshift'] or array-like) –
Input redshift.
Changed in version 7.0: Passing z as a keyword argument is deprecated.
Returns:
w – The dark energy equation of state.
Returns float if the input is scalar.
Return type:
ndarray or float
Notes
The dark energy equation of state is defined as
\(w(z) = P(z)/\rho(z)\), where \(P(z)\) is the pressure at
redshift z and \(\rho(z)\) is the density at redshift z, both in
units where c=1. Here this is \(w(z) = -1\).