wcosmo.astropy.WCosmoMixin#
- class wcosmo.astropy.WCosmoMixin[source]#
Mixin to provide access to the
wcosmo
functionality toastropy
cosmology objects.We clobber all units to ensure consistent behavior across backends.
Notes
The following methods are not compatible with non-
numpy
backends:kpc_comoving_per_arcmin
kpc_proper_per_arcmin
nu_relative_density
These methods internally coerce the input to
numpy
arrays if the backend supports implicit conversion. Additionally, we don’t overwrite the various integrands, protected methods, and other utility methods, e.g.,clone
.We include the following methods that are not present in
astropy
:dLdH
- derivative of the luminosity distance w.r.t. the Hubble distancedDLdz
- Jacobian for the conversion of luminosity distance to redshift, seedDLdz()
detector_to_source_frame
- convert masses and luminosity distance from the detector frame to the source frame, also returns the jacobian, seedetector_to_source_frame()
source_to_detector_frame
- convert masses and redshift from the source frame to the detector frame, seesource_to_detector_frame()
- __init__(*args, **kwargs)#
Methods
H
(z)Compute the Hubble parameter \(H(z)\) for a flat wCDM cosmology.
__init__
(*args, **kwargs)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_transverse_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.
de_density_scale
(z)Dark energy density at redshift z.
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.
distmod
(z)Compute the distance modulus at redshift z.
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
H0
hubble_distance
Compute the Hubble distance \(D_H = c H_0^{-1}\) in Mpc.
hubble_time
Compute the Hubble time \(t_H = H_0^{-1}\) in Gyr.