NcDistance

NcDistance — Cosmological distance and time related quantities.

Stability Level

Stable, unless otherwise indicated

Functions

gdouble (*NcDistanceFunc0) ()
gdouble (*NcDistanceFunc1) ()
NcDistance * nc_distance_new ()
NcDistance * nc_distance_ref ()
void nc_distance_require_zf ()
void nc_distance_set_recomb ()
void nc_distance_compute_inv_comoving ()
void nc_distance_prepare ()
void nc_distance_prepare_if_needed ()
void nc_distance_free ()
void nc_distance_clear ()
gdouble nc_distance_hubble ()
gdouble nc_distance_decoupling_redshift ()
gdouble nc_distance_drag_redshift ()
gdouble nc_distance_shift_parameter_lss ()
gdouble nc_distance_comoving_lss ()
gdouble nc_distance_acoustic_scale ()
gdouble nc_distance_theta100CMB ()
gdouble nc_distance_angular_diameter_curvature_scale ()
gdouble nc_distance_r_zd ()
gdouble nc_distance_r_zd_Mpc ()
gdouble nc_distance_comoving ()
gdouble nc_distance_transverse ()
gdouble nc_distance_dtransverse_dz ()
gdouble nc_distance_luminosity ()
gdouble nc_distance_angular_diameter ()
gdouble nc_distance_dmodulus ()
gdouble nc_distance_comoving_volume_element ()
gdouble nc_distance_sigma_critical ()
gdouble nc_distance_sigma_critical_infinity ()
gdouble nc_distance_luminosity_hef ()
gdouble nc_distance_dmodulus_hef ()
gdouble nc_distance_shift_parameter ()
gdouble nc_distance_dilation_scale ()
gdouble nc_distance_bao_A_scale ()
gdouble nc_distance_sound_horizon ()
gdouble nc_distance_dsound_horizon_dz ()
gdouble nc_distance_bao_r_Dv ()
gdouble nc_distance_DH_r ()
gdouble nc_distance_DA_r ()
gdouble nc_distance_Dt_r ()
gdouble nc_distance_comoving_z_to_infinity ()
gdouble nc_distance_transverse_z_to_infinity ()
gdouble nc_distance_transverse_z1_z2 ()
gdouble nc_distance_angular_diameter_z1_z2 ()
gdouble nc_distance_inv_comoving ()
gdouble nc_distance_cosmic_time ()
gdouble nc_distance_lookback_time ()
gdouble nc_distance_conformal_time ()
gdouble nc_distance_conformal_lookback_time ()

Properties

gboolean compute-inv-comoving Read / Write / Construct
NcRecomb * recomb Read / Write / Construct
double zf Read / Write / Construct

Types and Values

Object Hierarchy

    GEnum
    ╰── NcDistanceComovingMethod
    GObject
    ╰── NcDistance

Includes

#include <numcosmo/nc_distance.h>

Description

This object implements several distances used in cosmology, here we have the following definitions.

$ \newcommand{\RH}{{R_H}} \newcommand{\RHc}{{R^\mathrm{c}_H}} $

The Hubble radius (or scale) is defined as the inverse of the Hubble function $H(z)$ [nc_hicosmo_H()], \begin{equation}\label{eq:def:RHc} \RH = \frac{c}{H(z)}, \qquad \RH_0 = \frac{c}{H_0}, \end{equation} where $c$ is the speed of light [ncm_c_c()], $z$ is the redshift and $H_0 \equiv H(0)$ is the Hubble parameter [nc_hicosmo_H0()]. Similarly, we also define the comoving Hubble radius as \begin{equation}\label{eq:def:DH} \RHc(z) = \frac{c}{aH(z)} = \frac{c(1+z)}{a_0H(z)}, \qquad \RHc_0 = \frac{c}{a_0H_0} \end{equation} where ${}_0$ subscript means that the function is calculated at the present time and the redshift $z$ is defined by the expression $$1 + z = \frac{a_0}{a}.$$

The comoving distance $D_c$ is defined as \begin{equation}\label{eq:def:dc} d_c(z) = \RHc_0\int_0^z \frac{dz^\prime}{E (z^\prime)}, \end{equation} where $E(z)$ is the normalized Hubble function [nc_hicosmo_E()], i.e., \begin{equation}\label{eq:def:Ez} E(z) \equiv \frac{H(z)}{H_0}. \end{equation}

In this object we will compute the dimensionless version of the distances, for the comoving distance we define \begin{equation}\label{eq:def:Dc} D_c(z) \equiv \frac{d_c(z)}{\RHc_0}. \end{equation} note, however, that $D_c(z)$ coincides with the proper distance today $r(z) \equiv a_0 d_c(z)$ in unit of the Hubble radius, i.e., $D_c(z) = r(z) / \RH_0$. Therefore, both the comoving distance and the proper distance today can be obtained by multiplying $D_c(z)$ by $\RHc_0$ and $\RH_0$ respectively.

The transverse comoving distance $D_t$ and its derivative with respect to $z$ are given by \begin{equation}\label{eq:def:Dt} D_t(z) = \frac{\sinh\left[\sqrt{\Omega_{k0}}D_c(z)\right]}{\sqrt{\Omega_{k0}}}, \qquad \frac{dD_t}{dz}(z) = \frac{\cosh\left[\sqrt{\Omega_{k0}}D_c(z)\right]}{E(z)}, \end{equation} where $\Omega_{k0}$ is the value of the curvature today [nc_hicosmo_Omega_k0()]. Using the definition above we have that the luminosity and angular diameter distances are respectively: \begin{equation}\label{eq:def:Dl} D_l = (1 + z)D_t(z), \qquad D_A = D_t (z) / (1 + z), \end{equation} and the distance modulus is given by \begin{equation}\label{eq:def:dmu} \delta\mu(z) = 5\log_{10}(D_l(z)) + 25. \end{equation} Note that the distance modulus is defined as $$\mu(z) = 5\log_{10}[\RH_0D_l(z)/(1\,\text{Mpc})] + 25.$$ Thus, this differs from our definition by a factor of $5\log_{10}[\RH_0/(1\,\text{Mpc})]$, i.e., $$\mu(z) = \delta\mu(z) + 5\log_{10}[\RH_0/(1\,\text{Mpc})],$$ where $\text{Mpc}$ is megaparsec [ncm_c_Mpc()].

We also implement the following distances between $z_1$ and $z_2$: \begin{align}\label{eq:def:Dt12} D_t(z_1, z_2) &= \frac{\sinh\left\{\sqrt{\Omega_{k0}}\left[D_c(z_2)-D_c(z_1)\right]\right\}}{\sqrt{\Omega_{k0}}}, \\ \label{eq:def:DA12} D_A(z_1, z_2) &= D_t (z_1, z_2) / (1 + z_2). \end{align}

Functions

NcDistanceFunc0 ()

gdouble
(*NcDistanceFunc0) (NcDistance *dist,
                    NcHICosmo *cosmo);

NcDistanceFunc1 ()

gdouble
(*NcDistanceFunc1) (NcDistance *dist,
                    NcHICosmo *cosmo,
                    gdouble z);

nc_distance_new ()

NcDistance *
nc_distance_new (gdouble zf);

Creates a new NcDistance object optimized to perform distance calculations to redshift up to zf .

Parameters

zf

final redshift

 

Returns

a new NcDistance.


nc_distance_ref ()

NcDistance *
nc_distance_ref (NcDistance *dist);

Increases the reference count of dist atomically.

Parameters

dist

a NcDistance

 

Returns

dist .

[transfer full]


nc_distance_require_zf ()

void
nc_distance_require_zf (NcDistance *dist,
                        const gdouble zf);

Requires the final redshift of at least zf .

Parameters

dist

a NcDistance

 

zf

maximum redshift required

 

nc_distance_set_recomb ()

void
nc_distance_set_recomb (NcDistance *dist,
                        NcRecomb *recomb);

This function sets recomb into dist .

Parameters

dist

a NcDistance

 

recomb

a NcRecomb

 

nc_distance_compute_inv_comoving ()

void
nc_distance_compute_inv_comoving (NcDistance *dist,
                                  gboolean cpu_inv_xi);

Enable/Disable the computation of $z(\xi)$

Parameters

dist

a NcDistance

 

cpu_inv_xi

whether to compute the inverse function $z(\xi)$

 

nc_distance_prepare ()

void
nc_distance_prepare (NcDistance *dist,
                     NcHICosmo *cosmo);

This function prepares the object dist using cosmo , such that all the available distances functions can be evaluated, e.g. nc_distance_comoving().

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

nc_distance_prepare_if_needed ()

void
nc_distance_prepare_if_needed (NcDistance *dist,
                               NcHICosmo *cosmo);

This function prepares the object dist using cosmo if it was changed since last preparation.

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

nc_distance_free ()

void
nc_distance_free (NcDistance *dist);

Atomically decrements the reference count of dist by one. If the reference count drops to 0, all memory allocated by dist is released.

Parameters

dist

a NcDistance

 

nc_distance_clear ()

void
nc_distance_clear (NcDistance **dist);

Atomically decrements the reference count of dist by one. If the reference count drops to 0, all memory allocated by dist is released. Set pointer to NULL.

Parameters

dist

a NcDistance

 

nc_distance_hubble ()

gdouble
nc_distance_hubble (NcDistance *dist,
                    NcHICosmo *cosmo);

Calculate the curvature scale today as defined in Eq $\eqref{eq:def:DH}$ in units of megaparsec (Mpc) [ncm_c_Mpc()].

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

Returns

$D_{H0}$.


nc_distance_decoupling_redshift ()

gdouble
nc_distance_decoupling_redshift (NcDistance *dist,
                                 NcHICosmo *cosmo);

The decoupling redshift $z_\star$ corresponds to the epoch of the last scattering surface of the cosmic microwave background photons.

This function computes $z_\star$ using [nc_hicosmo_z_lss()], if cosmo implements it, or using Hu & Sugiyama fitting formula Hu (1996)[arXiv], $$ z_\star = 1048 \left(1 + 1.24 \times 10^{-3} (\Omega_{b0} h^2)^{-0.738}\right) \left(1 + g_1 (\Omega_{m0} h^2)^{g_2}\right),$$ where $\Omega_{b0} h^2$ [nc_hicosmo_Omega_b0h2()] and $\Omega_{m0} h^2$ [nc_hicosmo_Omega_m0h2()] are, respectively, the baryonic and matter density parameters times the square of the dimensionless Hubble parameter $h$, $H_0 = 100 \, h \, \text{km/s} \, \text{Mpc}^{-1}$. The parameters $g_1$ and $g_2$ are given by $$g_1 = \frac{0.0783 (\Omega_{b0} h^2)^{-0.238}}{(1 + 39.5 (\Omega_{b0} h^2)^{0.763})} \; \text{and} \; g_2 = \frac{0.56}{\left(1 + 21.1 (\Omega_{b0} h^2)^{1.81}\right)}.$$

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

Returns

$z_\star$.


nc_distance_drag_redshift ()

gdouble
nc_distance_drag_redshift (NcDistance *dist,
                           NcHICosmo *cosmo);

Drag redshift is the epoch at which baryons were released from photons.

If the dist object constains a NcRecomb object, it calculates the drag redshift through the recombination history. Otherwise, it computes $z_d$ using the fitting formula given in Eisenstein &amp; Hu (1998) [arXiv], $$z_d = \frac{1291 (\Omega_{m0} h^2)^{0.251}}{(1 + 0.659 (\Omega_{m0} h^2)^{0.828})} \left(1 + b_1 (\Omega_{b0} h^2)^{b_2}\right),$$ where $\Omega_{b0} h^2$ [nc_hicosmo_Omega_b0h2()] and $\Omega_{m0} h^2$ [nc_hicosmo_Omega_m0h2()] are, respectively, the baryonic and matter density parameters times the square of the dimensionless Hubble parameter $h$, $H_0 = 100 \, h \, \text{km/s} \, \text{Mpc}^{-1}$. The parameters $b_1$ and $b_2$ are given by $$b_1 = 0.313 (\Omega_{m0} h^2)^{-0.419} \left(1 + 0.607 (\Omega_{m0} h^2)^{0.674}\right) \; \text{and} \; b_2 = 0.238 (\Omega_{m0} h^2)^{0.223}.$$

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

Returns

$z_d$.


nc_distance_shift_parameter_lss ()

gdouble
nc_distance_shift_parameter_lss (NcDistance *dist,
                                 NcHICosmo *cosmo);

Compute the shift parameter $R(z)$ [nc_distance_shift_parameter()] at the decoupling redshift $z_\star$ [nc_distance_decoupling_redshift()].

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

Returns

$R(z_\star)$.


nc_distance_comoving_lss ()

gdouble
nc_distance_comoving_lss (NcDistance *dist,
                          NcHICosmo *cosmo);

Compute the comoving distance $D_c(z)$ [Eq. \eqref{eq:def:Dc}] at the decoupling redshift $z_\star$ [nc_distance_decoupling_redshift()].

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

Returns

$D_c(z_\star)$.


nc_distance_acoustic_scale ()

gdouble
nc_distance_acoustic_scale (NcDistance *dist,
                            NcHICosmo *cosmo);

Compute the acoustic scale $l_A (z_\star)$ at $z_\star$ [nc_distance_decoupling_redshift()], \begin{equation*} l_A(z_\star) = \pi \frac{D_t (z_\star)}{r_s (z_\star)}, \end{equation*} where $D_t(z_\star)$ is the comoving transverse distance [nc_distance_transverse()] and $r_s(z_\star)$ is the sound horizon [nc_distance_sound_horizon()] both computed at $z_\star$.

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

Returns

$l_A(z_\star)$.


nc_distance_theta100CMB ()

gdouble
nc_distance_theta100CMB (NcDistance *dist,
                         NcHICosmo *cosmo);

Compute the $100\theta_\mathrm{CMB}$ angle at $z_\star$ [nc_distance_decoupling_redshift()], \begin{equation*} 100\theta_\mathrm{CMB} = 100 \times \frac{r_s (z_\star)}{D_t (z_\star)}, \end{equation*} where $D_t(z_\star)$ is the comoving transverse distance [nc_distance_transverse()] and $r_s(z_\star)$ is the sound horizon [nc_distance_sound_horizon()] both both computed at $z_\star$.

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

Returns

$100\theta_\mathrm{CMB}$.


nc_distance_angular_diameter_curvature_scale ()

gdouble
nc_distance_angular_diameter_curvature_scale
                               (NcDistance *dist,
                                NcHICosmo *cosmo);

We define the angular diameter curvature scale $D_a(z_\star)$ as $$D_a(z_\star) = \frac{E(z_\star)}{1 + z_\star} D_t(z_\star),$$ where $z_\star$ is the decoupling redshift, given by [nc_distance_decoupling_redshift()], $E(z_\star)$ is the normalized Hubble function [Eq. $\eqref{eq:def:Ez}$] and $D_t(z_\star)$ is the transverse comoving distance [Eq. $\eqref{eq:def:Dt}$] both computed at $z_\star$.

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

Returns

$D_a(z_\star)$.


nc_distance_r_zd ()

gdouble
nc_distance_r_zd (NcDistance *dist,
                  NcHICosmo *cosmo);

This function computes the sound horizon [nc_distance_sound_horizon()] at the drag redshift [nc_distance_drag_redshift()].

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

Returns

$r(z_d)$.


nc_distance_r_zd_Mpc ()

gdouble
nc_distance_r_zd_Mpc (NcDistance *dist,
                      NcHICosmo *cosmo);

Similar as nc_distance_r_zd(), but now in units of $\mathrm{Mpc}$, i.e., $ R_H \times r(z_d)$.

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

Returns

r_zd in $ \left[ \mathrm{Mpc} \right]$ units.


nc_distance_comoving ()

gdouble
nc_distance_comoving (NcDistance *dist,
                      NcHICosmo *cosmo,
                      const gdouble z);

Calculate the comoving distance $D_c (z)$ as defined in Eq. $\eqref{eq:def:Dc}$.

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

z

redshift $z$

 

Returns

$D_c(z)$.


nc_distance_transverse ()

gdouble
nc_distance_transverse (NcDistance *dist,
                        NcHICosmo *cosmo,
                        const gdouble z);

Compute the transverse comoving distance $D_t (z)$ defined in Eq. $\eqref{eq:def:Dt}$.

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

z

redshift $z$

 

Returns

$D_t(z)$.


nc_distance_dtransverse_dz ()

gdouble
nc_distance_dtransverse_dz (NcDistance *dist,
                            NcHICosmo *cosmo,
                            const gdouble z);

Compute the derivative of $D_t(z)$ with respect to $z$ defined in Eq. $\eqref{eq:def:Dt}$.

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

z

redshift $z$

 

Returns

$\frac{dD_t(z)}{dz}$.


nc_distance_luminosity ()

gdouble
nc_distance_luminosity (NcDistance *dist,
                        NcHICosmo *cosmo,
                        const gdouble z);

Compute the luminosity distance $D_l(z)$ defined in Eq. $\eqref{eq:def:Dl}$.

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

z

redshift $z$

 

Returns

$D_l(z)$.


nc_distance_angular_diameter ()

gdouble
nc_distance_angular_diameter (NcDistance *dist,
                              NcHICosmo *cosmo,
                              const gdouble z);

Compute the angular diameter $D_A(z)$, defined in Eq. $\eqref{eq:def:Dl}$.

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

z

redshift $z$

 

Returns

$D_A(z)$.


nc_distance_dmodulus ()

gdouble
nc_distance_dmodulus (NcDistance *dist,
                      NcHICosmo *cosmo,
                      const gdouble z);

Compute the distance modulus $\delta\mu(z)$ defined in Eq. $\eqref{eq:def:dmu}$.

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

z

redshift $z$

 

Returns

$\delta\mu(z)$.


nc_distance_comoving_volume_element ()

gdouble
nc_distance_comoving_volume_element (NcDistance *dist,
                                     NcHICosmo *cosmo,
                                     gdouble z);

This function computes the comoving volume element per unit solid angle $d\Omega$ given z , namely, $$\frac{\mathrm{d}^2V}{\mathrm{d}z\mathrm{d}\Omega} = \frac{D_t^2(z)}{E(z)} = \frac{(1 + z)^2 D_a^2(z)}{E(z)},$$ where $E(z)$ is the normalized Hubble function and $D_t$ is the transverse comoving distance (and $D_a$ is the angular diameter distance).

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

z

redshift $z$

 

Returns

comoving volume element $\frac{\mathrm{d}^2V}{\mathrm{d}z\mathrm{d}\Omega}$.


nc_distance_sigma_critical ()

gdouble
nc_distance_sigma_critical (NcDistance *dist,
                            NcHICosmo *cosmo,
                            const gdouble zs,
                            const gdouble zl);

Computes the critical surface density, \begin{equation}\label{eq:def:SigmaC} \Sigma_c = \frac{c^2}{4\pi G} \frac{D_s}{D_l D_{ls}}, \end{equation} where $c^2$ is the speed of light squared [ncm_c_c2()], $G$ is the gravitational constant in units of $m^3/s^2 M_\odot^{-1}$ [ncm_c_G_mass_solar()], $D_s$ ($D_l$) is the angular diameter distance from the observer to the source (lens), and $D_{ls}$ is the angular diameter distance between the lens and the source.

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

zs

source redshift $z_\mathrm{source}$

 

zl

lens redshift $z_\mathrm{lens}$

 

Returns

the critical surface density $\Sigma_c$ in units of $M_\odot / Mpc^2$


nc_distance_sigma_critical_infinity ()

gdouble
nc_distance_sigma_critical_infinity (NcDistance *dist,
                                     NcHICosmo *cosmo,
                                     const gdouble zl);

Computes the critical surface density, \begin{equation}\label{eq:def:SigmaC} \Sigma_c = \frac{c^2}{4\pi G} \frac{D_\infty}{D_l D_{l\infty}}, \end{equation} where $c^2$ is the speed of light squared [ncm_c_c2()], $G$ is the gravitational constant in units of $m^3/s^2 M_\odot^{-1}$ [ncm_c_G_mass_solar()], $D_\infty$ ($D_l$) is the angular diameter distance from the observer to the source at infinite redshift (lens), and $D_{l\infty}$ is the angular diameter the lens and the source.

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

zl

lens redshift $z_\mathrm{lens}$

 

Returns

the critical surface density $\Sigma_c$ in units of $M_\odot / Mpc^2$


nc_distance_luminosity_hef ()

gdouble
nc_distance_luminosity_hef (NcDistance *dist,
                            NcHICosmo *cosmo,
                            const gdouble z_he,
                            const gdouble z_cmb);

Calculate the luminosity distance $D_l$ corrected to our local frame.

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

z_he

redshift $z_{he}$ in our local frame

 

z_cmb

redshift $z_{CMB}$ in the CMB frame

 

Returns

$D_l(z_{hef},z_{CMB})$.


nc_distance_dmodulus_hef ()

gdouble
nc_distance_dmodulus_hef (NcDistance *dist,
                          NcHICosmo *cosmo,
                          const gdouble z_he,
                          const gdouble z_cmb);

Calculate the distance modulus [Eq. $\eqref{eq:def:dmu}$] using the frame corrected luminosity distance [nc_distance_luminosity_hef()].

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

z_he

redshift $z_{he}$ in our local frame

 

z_cmb

redshift $z_{CMB}$ in the CMB frame

 

Returns

$\delta\mu(z_{hef},z_{CMB})$.


nc_distance_shift_parameter ()

gdouble
nc_distance_shift_parameter (NcDistance *dist,
                             NcHICosmo *cosmo,
                             const gdouble z);

The shift parameter $R(z)$ is defined as \begin{equation*} R(z) = \frac{\sqrt{\Omega_{m0} H_0^2}}{c} (1 + z) D_A(z) = \sqrt{\Omega_{m0}} D_t(z), \end{equation*} where $\Omega_{m0}$ is the matter density paremeter [nc_hicosmo_Omega_m0()], $D_A(z) = D_{H_0} D_t(z) / (1 + z)$ is the angular diameter distance and $D_t(z)$ is the tranverse comoving distance [Eq. $\eqref{eq:def:Dt}$].

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

z

redshift $z$

 

Returns

$R(z)$.


nc_distance_dilation_scale ()

gdouble
nc_distance_dilation_scale (NcDistance *dist,
                            NcHICosmo *cosmo,
                            const gdouble z);

The dilation scale is the spherically averaged distance for perturbations along and orthogonal to the line of sight, $$D_V(z) = \left[D_{H_0}^2 D_t(z)^2 \frac{cz}{H(z)} \right]^{1/3},$$ where $D_t(z)$ is the transverse comoving distance [Eq. $\eqref{eq:def:Dt}$], $c$ is the speed of light [ncm_c_c()] and $H(z)$ is the Hubble function [nc_hicosmo_H()]. See Eisenstein et al. (2005) [arXiv].

This function computes the dimensionless dilation scale: $$D_V^\star(z) = \left[D_t(z)^2 \frac{z}{E(z)} \right]^{1/3} = \frac{D_V(z)}{D_{H_0}},$$ where $E(z)$ is the normalized Hubble function [nc_hicosmo_E2()].

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

z

redshift $z$

 

Returns

$D_V^\star(z)$.


nc_distance_bao_A_scale ()

gdouble
nc_distance_bao_A_scale (NcDistance *dist,
                         NcHICosmo *cosmo,
                         const gdouble z);

This function returns the BAO $A$ parameter. It is defined as $$ A \equiv D_V (z) \frac{\sqrt{\Omega_{m0} H_0^2}}{z c},$$ where $\Omega_{m0}$ is the matter density parameter [nc_hicosmo_Omega_m0()], $c$ is the speed of light [ncm_c_c()], $H_0$ is the Hubble parameter [nc_hicosmo_H0()] and $D_V(z)$ is the dilation scale [nc_distance_dilation_scale()]. See Section 4.5 from Eisenstein et al. (2005) [arXiv].

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

z

the redshift $z$

 

Returns

$A(z)$.


nc_distance_sound_horizon ()

gdouble
nc_distance_sound_horizon (NcDistance *dist,
                           NcHICosmo *cosmo,
                           const gdouble z);

Compute the sound horizon $r_s$, \begin{equation} \theta_s (z) = \int_{z}^\infty \frac{c_s(z^\prime)}{E(z^\prime)} dz^\prime, \quad r_s (z) = \frac{\mathrm{sinn}\left(\sqrt{\Omega_{k0}}\theta_s\right)}{\sqrt{\Omega_{k0}}}, \end{equation} where $c_s = \sqrt{c^{b\gamma 2}_s(z)}$ is the baryon-photon plasma speed of sound (see nc_hicosmo_bgp_cs2() for more details) and $E(z)$ is the normalized Hubble function [nc_hicosmo_E()].

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

z

redshift $z$

 

Returns

$r_s(z)$.


nc_distance_dsound_horizon_dz ()

gdouble
nc_distance_dsound_horizon_dz (NcDistance *dist,
                               NcHICosmo *cosmo,
                               const gdouble z);

Calculate the sound horizon [nc_distance_sound_horizon()] derivative with respect to $z$, $$\frac{d r_s(z)}{dz} = - \frac{c_s(z)}{E(z)}\, ,$$ where $c_s = \sqrt{c^{b\gamma 2}_s(z)}$ is the baryon-photon plasma speed of sound (see nc_hicosmo_bgp_cs2() for more details) and $E(z)$ is the normalized Hubble function [nc_hicosmo_E()].

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

z

redshift $z$

 

Returns

$\frac{d r_s(z)}{dz}$.


nc_distance_bao_r_Dv ()

gdouble
nc_distance_bao_r_Dv (NcDistance *dist,
                      NcHICosmo *cosmo,
                      const gdouble z);

This function computes $r(z_d) / D_V(z)$, where $r(z_d)$ is given by nc_distance_r_zd() and $D_V(z)$ by nc_distance_dilation_scale(). For more information see Percival et al. (2007) [arXiv].

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

z

the redshift $z$

 

Returns

$r(z_d) / D_V(z)$.


nc_distance_DH_r ()

gdouble
nc_distance_DH_r (NcDistance *dist,
                  NcHICosmo *cosmo,
                  const gdouble z);

Computes the ratio between the Hubble (distance) radius and the sound horizon at the drag epoch, $$\frac{R_H}{r_s(z_d)} = \frac{c}{H(z) r_d}.$$

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

z

the redshift $z$

 

Returns

$R_H/r_d = c / (H(z) r_d)$.


nc_distance_DA_r ()

gdouble
nc_distance_DA_r (NcDistance *dist,
                  NcHICosmo *cosmo,
                  const gdouble z);

Computes the ratio between the angular-diameter distance and the sound horizon at the drag epoch, $$\frac{D_A(z)}{c \, r_s(z_d)}.$$

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

z

the redshift $z$

 

Returns

$D_A(z) / (c \, r_d)$.


nc_distance_Dt_r ()

gdouble
nc_distance_Dt_r (NcDistance *dist,
                  NcHICosmo *cosmo,
                  const gdouble z);

Computes the ratio between the transverse distance and the sound horizon at the drag epoch, $$\frac{D_t(z)}{c \, r_s(z_d)}.$$

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

z

the redshift $z$

 

Returns

$D_t(z) / (c \, r_d)$.


nc_distance_comoving_z_to_infinity ()

gdouble
nc_distance_comoving_z_to_infinity (NcDistance *dist,
                                    NcHICosmo *cosmo,
                                    const gdouble z);

Computes the comoving distance from z to infinity.

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

z

redshift

 

Returns

$D_c$ from $z$ to $\infty$.


nc_distance_transverse_z_to_infinity ()

gdouble
nc_distance_transverse_z_to_infinity (NcDistance *dist,
                                      NcHICosmo *cosmo,
                                      const gdouble z);

Compute the transverse comoving distance $D_t (z)$ (defined in Eq. $\eqref{eq:def:Dt}$) but from z to infinity.

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

z

redshift $z$

 

Returns

$D_t(z)$ from $z$ to $\infty$.


nc_distance_transverse_z1_z2 ()

gdouble
nc_distance_transverse_z1_z2 (NcDistance *dist,
                              NcHICosmo *cosmo,
                              const gdouble z1,
                              const gdouble z2);

Compute the transverse comoving distance between $z_1$ and $z_2$, $D_t (z1, z2)$ defined in Eq. $\eqref{eq:def:Dt12}$.

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

z1

redshift $z_1$

 

z2

redshift $z_2$

 

Returns

$D_t(z_1, z_2)$.


nc_distance_angular_diameter_z1_z2 ()

gdouble
nc_distance_angular_diameter_z1_z2 (NcDistance *dist,
                                    NcHICosmo *cosmo,
                                    const gdouble z1,
                                    const gdouble z2);

Compute the angular diameter $D_A(z_1, z_2)$, defined in Eq. $\eqref{eq:def:DA12}$.

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

z1

redshift $z_1$

 

z2

redshift $z_2$

 

Returns

$D_A(z_1, z_2)$.


nc_distance_inv_comoving ()

gdouble
nc_distance_inv_comoving (NcDistance *dist,
                          NcHICosmo *cosmo,
                          gdouble xi);

Computes the inverse of $\xi(z)$.

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

xi

the comoving distance $\xi$

 

Returns

$z(\xi)$


nc_distance_cosmic_time ()

gdouble
nc_distance_cosmic_time (NcDistance *dist,
                         NcHICosmo *cosmo,
                         const gdouble z);

This function computes the cosmological time, $t(z)$, defined as \begin{equation*} t(z) = \int_z^{\infty} \frac{dx}{(1+x)E(x)}. \end{equation*}

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

z

redshift $z$

 

Returns

$t(z)$.


nc_distance_lookback_time ()

gdouble
nc_distance_lookback_time (NcDistance *dist,
                           NcHICosmo *cosmo,
                           const gdouble z);

This functions computes the look-back time, $t_{lb}(z)$, defined as

\begin{equation*} t_{lb}(z) = \int_0^{z} \frac{dx}{(1+x)E(x)}. \end{equation*}

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

z

redshift $z$

 

Returns

$t_{lb}(z)$.


nc_distance_conformal_time ()

gdouble
nc_distance_conformal_time (NcDistance *dist,
                            NcHICosmo *cosmo,
                            const gdouble z);

This function computes the cosmological conformal time $\eta(z)$ defined as $$ \eta(z) = \int_z^\infty \frac{dz}{E(z)} \, . $$

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

z

redshift $z$

 

Returns

$\eta(z)$.


nc_distance_conformal_lookback_time ()

gdouble
nc_distance_conformal_lookback_time (NcDistance *dist,
                                     NcHICosmo *cosmo,
                                     const gdouble z);

This function computes the conformal look-back time $\eta_{lb}(z)$. Within the chosen units it becomes the same as the comoving distance [nc_distance_comoving()], given in Eq. $\eqref{eq:def:dc}$.

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

z

redshift $z$

 

Returns

$\eta_{lb}(z)$.

Types and Values

enum NcDistanceComovingMethod

Enumeration to define which method to be applied in order to compute the cosmological distances.

Members

NC_DISTANCE_COMOVING_METHOD_INT_E

performs a numerical evaluation.

 

NC_DISTANCE_COMOVING_METHOD_FROM_MODEL

uses the method defined by the implementation of NcHICosmo.

 

Property Details

The “compute-inv-comoving” property

  “compute-inv-comoving”     gboolean

Whether to compute the inverse comoving function.

Owner: NcDistance

Flags: Read / Write / Construct

Default value: FALSE


The “recomb” property

  “recomb”                   NcRecomb *

The recombination object, NcRecomb, used by NcDistance.

Owner: NcDistance

Flags: Read / Write / Construct


The “zf” property

  “zf”                       double

The final redhift to compute cosmological distances and related quantities.

Owner: NcDistance

Flags: Read / Write / Construct

Allowed values: >= 0

Default value: 10