wcosmo.wcosmo.FlatLambdaCDM#

class wcosmo.wcosmo.FlatLambdaCDM(H0, Om0, *, zmin=0.0001, zmax=100, name=None, meta=None)[source]#

Bases: FlatwCDM

Implementation of a flat \(\Lambda\rm{CDM}\) cosmology to (approximately) match the astropy API. This is the same as the FlatwCDM with \(w_0=-1\).

\[E(z) = \sqrt{\Omega_{m,0} (1 + z)^3 + (1 - \Omega_{m,0})}\]
Parameters:
H0: array_like

The Hubble constant in km/s/Mpc

Om0: array_like

The matter density fraction

zmin: float

The minimum redshift used in the conversion from distance to redshift, default=1e-4

zmax: float

The maximum redshift used in the conversion from distance to redshift, default=100

name: str

The name for the cosmology, mostly used for fixed instances

meta: dict

Additional metadata describing the cosmology, e.g., citation information

__init__(H0, Om0, *, zmin=0.0001, zmax=100, name=None, meta=None)[source]#

Methods

H(z)

Compute the Hubble parameter \(H(z)\) for a flat wCDM cosmology.

__init__(H0, Om0, *[, zmin, zmax, name, meta])

absorption_distance(z)

Compute the absorption distance using an analytic integral of the Pade approximation.

age(z[, zmax])

Compute the age of the universe at redshift z.

comoving_distance(z)

Compute the comoving distance using an analytic integral of the Pade approximation.

comoving_volume(z)

Compute the comoving volume out to redshift z.

dDLdz(z)

The Jacobian for the conversion of redshift to luminosity distance.

dLdH(z)

Derivative of the luminosity distance w.r.t.

detector_to_source_frame(m1z, m2z, dL)

Convert masses and luminosity distance from the detector frame to source frame masses and redshift.

differential_comoving_volume(z)

Compute the differential comoving volume element.

efunc(z)

Compute the \(E(z)\) function for a flat wCDM cosmology.

inv_efunc(z)

Compute the inverse of the E(z) function for a flat wCDM cosmology.

lookback_time(z)

Compute the lookback time using an analytic integral of the Pade approximation.

luminosity_distance(z)

Compute the luminosity distance using an analytic integral of the Pade approximation.

source_to_detector_frame(m1, m2, z)

Convert masses and redshift from the source frame to the detector frame.

Attributes

hubble_distance

Compute the Hubble distance \(D_H = c H_0^{-1}\) in Mpc.

meta

Meta data for the cosmology to hold additional information, e.g., citation information

H(z)#

Compute the Hubble parameter \(H(z)\) for a flat wCDM cosmology.

\[H(z; H_0, \Omega_{m,0}, w_0) = \frac{d_H(H_0)}{E(z; \Omega_{m,0}, w_0)}\]
Parameters:
z: array_like

Redshift

Returns:
H(z): array_like

The Hubble parameter

absorption_distance(z)#

Compute the absorption distance using an analytic integral of the Pade approximation.

\[d_{A} = \int_{0}^{z} \frac{dz' (1 + z')^2}{E(z'; \Omega_{m,0}, w_0)}\]
Parameters:
z: array_like

Redshift

Returns:
absorption_distance: array_like

The absorption distance in Mpc

age(z, zmax=100000.0)#

Compute the age of the universe at redshift z.

Parameters:
z: array_like
Redshift
zmax: float, optional

The maximum redshift to consider, default is 1e5

Returns:
age: array_like

The age of the universe in Gyr

comoving_distance(z)#

Compute the comoving distance using an analytic integral of the Pade approximation.

\[d_{C} = d_{H} \int_{0}^{z} \frac{dz'}{E(z'; \Omega_{m,0}, w_0)}\]
Parameters:
z: array_like

Redshift

Returns:
comoving_distance: array_like

The comoving distance in Mpc

comoving_volume(z)#

Compute the comoving volume out to redshift z.

\[V_C = \frac{4\pi}{3} d^3_C(z; H_0, \Omega_{m,0}, w_0)\]
Parameters:
z: array_like

Redshift

Returns:
Vc: array_like

The comoving volume in \(\rm{Gpc}^3\)

dDLdz(z)#

The Jacobian for the conversion of redshift to luminosity distance.

\[\frac{dd_{L}}{z} = d_C(z; H_0, \Omega_{m,0}, w_0) + (1 + z) d_{H} E(z; \Omega_{m, 0}, w0)\]

Here \(d_{C}\) is comoving distance and \(d_{H}\) is the Hubble distance.

Parameters:
z: array_like

Redshift

Returns:
dDLdz: array_like

The derivative of the luminosity distance with respect to redshift in Mpc

Notes

This function does not have a direct analog in the astropy cosmology objects, but is needed for accounting for expressing distributions of redshift as distributions over luminosity distance.

dLdH(z)#

Derivative of the luminosity distance w.r.t. the Hubble distance.

\[\frac{dd_L}{dd_H} = \frac{d_L}{d_H}\]
Parameters:
z: array_like
Redshift
Returns:
array_like:

The derivative of the luminosity distance w.r.t., the Hubble distance

detector_to_source_frame(m1z, m2z, dL)#

Convert masses and luminosity distance from the detector frame to source frame masses and redshift.

This passes through the arguments to z_at_value to compute the redshift.

Parameters:
m1z: array_like

The primary mass in the detector frame

m2z: array_like

The secondary mass in the detector frame

dL: array_like

The luminosity distance in Mpc

zmin: float

The minimum redshift used in the conversion from distance to redshift, default=1e-4

zmax: float

The maximum redshift used in the conversion from distance to redshift, default=100

Returns:
m1, m2, z: array_like

The primary and secondary masses in the source frame and the redshift

differential_comoving_volume(z)#

Compute the differential comoving volume element.

\[\frac{dV_{C}}{dz} = d_C^2(z; H_0, \Omega_{m,0}, w_0) d_H E(z; \Omega_{m, 0}, w_0)\]
Parameters:
z: array_like

Redshift

Returns:
dVc: array_like

The differential comoving volume element in \(\rm{Gpc}^3\)

efunc(z)#

Compute the \(E(z)\) function for a flat wCDM cosmology.

\[E(z; \Omega_{m,0}, w_0) = \sqrt{\Omega_{m,0} (1 + z)^3 + (1 - \Omega_{m,0}) (1 + z)^{3(1 + w_0)}}\]
Parameters:
z: array_like

Redshift

Returns:
E(z): array_like

The E(z) function

property hubble_distance#

Compute the Hubble distance \(D_H = c H_0^{-1}\) in Mpc.

Returns:
D_H: float

The Hubble distance in Mpc

inv_efunc(z)#

Compute the inverse of the E(z) function for a flat wCDM cosmology.

Parameters:
z: array_like

Redshift

Returns:
inv_efunc: array_like

The inverse of the E(z) function

lookback_time(z)#

Compute the lookback time using an analytic integral of the Pade approximation.

\[t_{L} = t_{H} \int_{0}^{z} \frac{dz'}{(1 + z')E(z'; \Omega_{m,0}, w_0)}\]
Parameters:
z: array_like

Redshift

Returns:
lookback_time: array_like

The lookback time in km / s / Mpc

luminosity_distance(z)#

Compute the luminosity distance using an analytic integral of the Pade approximation.

\[d_L = (1 + z') d_{H} \int_{0}^{z} \frac{dz'}{E(z'; \Omega_{m,0}, w_0)}\]
Parameters:
z: array_like

Redshift

Returns:
luminosity_distance: array_like

The luminosity distance in Mpc

property meta#

Meta data for the cosmology to hold additional information, e.g., citation information

source_to_detector_frame(m1, m2, z)#

Convert masses and redshift from the source frame to the detector frame.

Parameters:
m1: array_like

The primary mass in the source frame

m2: array_like

The secondary mass in the source frame

z: array_like

Redshift

Returns:
m1z, m2z, dL: array_like

The primary and secondary masses in the detector frame and the luminosity distance