NcDistance

NcDistance — Cosmological distance and time related quantities.

Functions

gdouble (*NcDistanceFunc0) ()
gdouble (*NcDistanceFunc1) ()
GArray * nc_distance_class_func_table ()
GArray * nc_distance_class_func_z_table ()
NcDistanceFunc * nc_distance_class_get_func ()
NcDistanceFuncZ * nc_distance_class_get_func_z ()
NcDistance * nc_distance_new ()
NcDistance * nc_distance_ref ()
void nc_distance_prepare ()
void nc_distance_prepare_if_needed ()
void nc_distance_free ()
void nc_distance_clear ()
NcmMSetFunc * nc_distance_func0_new ()
NcmMSetFunc * nc_distance_func1_new ()
NcmMSetFunc * nc_distance_create_mset_arrayfunc1 ()
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_Omega_k ()
gdouble nc_distance_angular_diameter_curvature_scale ()
gdouble nc_distance_r_zd ()
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_modulus ()
gdouble nc_distance_luminosity_hef ()
gdouble nc_distance_modulus_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_cosmic_time ()
gdouble nc_distance_lookback_time ()
gdouble nc_distance_conformal_time ()
gdouble nc_distance_conformal_lookback_time ()
gdouble nc_distance_cosmic_time_mks_scale ()
gdouble nc_distance_conformal_time_mks_scale ()

Properties

gdouble zf Read / Write / Construct

Object Hierarchy

    GObject
    ╰── NcDistance

Description

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

The Hubble scale is simply defined as the inverse of the Hubble function $H(z)$ [nc_hicosmo_H()], \begin{equation}\label{eq:def:DH} D_H(z) = \frac{c}{H(z)}, \qquad D_{H0} = \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()]. The comoving distance $D_c$ is defined as \begin{equation}\label{eq:def:Dc} D_c(z) = \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} Note that both quantities are adimensional, in other words, one can think them as in units of the Hubble scale today.

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_k()]. 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:mu} \mu(z) = 5\log_{10}(D_l(z)) + 25, \end{equation} where $\log_{10}$ represents the logarithm in the decimal base. Note that the distance modulus is usually defined as $$5\log_{10}(D_{H0}D_l(z)/\text{pc}) - 5,$$ where $\text{pc}$ is parsec [ncm_c_pc()]. Thus, this differs from our definition by a factor of $5\log_{10}(D_{H0}/\text{Mpc})$, where $\text{Mpc}$ is megaparsec [ncm_c_Mpc()].

Functions

NcDistanceFunc0 ()

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

NcDistanceFunc1 ()

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

nc_distance_class_func_table ()

GArray *
nc_distance_class_func_table (void);

Returns

the function table.

[transfer container][element-type NcDistanceFunc]


nc_distance_class_func_z_table ()

GArray *
nc_distance_class_func_z_table (void);

Returns

the function table.

[transfer container][element-type NcDistanceFuncZ]


nc_distance_class_get_func ()

NcDistanceFunc *
nc_distance_class_get_func (const gchar *name);

Parameters

name

function name.

 

Returns

the function name or null if not found.

[transfer none]


nc_distance_class_get_func_z ()

NcDistanceFuncZ *
nc_distance_class_get_func_z (const gchar *name);

Parameters

name

function name.

 

Returns

the function name or null if not found.

[transfer none]


nc_distance_new ()

NcDistance *
nc_distance_new (gdouble z_f);

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

Parameters

z_f

final redshift $z_f$

 

Returns

a new NcDistance


nc_distance_ref ()

NcDistance *
nc_distance_ref (NcDistance *dist);

FIXME

Parameters

dist

a NcDistance

 

Returns

FIXME.

[transfer full]


nc_distance_prepare ()

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

FIXME

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

nc_distance_prepare_if_needed ()

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

FIXME

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

nc_distance_free ()

void
nc_distance_free (NcDistance *dist);

FIXME

Parameters

dist

a NcDistance

 

nc_distance_clear ()

void
nc_distance_clear (NcDistance **dist);

FIXME

Parameters

dist

a NcDistance

 

nc_distance_func0_new ()

NcmMSetFunc *
nc_distance_func0_new (NcDistance *dist,
                       NcDistanceFunc0 f0);

Parameters

dist

a NcDistance

 

f0

FIXME.

[scope notified]

Returns

FIXME.

[transfer full]


nc_distance_func1_new ()

NcmMSetFunc *
nc_distance_func1_new (NcDistance *dist,
                       NcDistanceFunc1 f1);

Parameters

dist

a NcDistance

 

f1

FIXME.

[scope notified]

Returns

FIXME.

[transfer full]


nc_distance_create_mset_arrayfunc1 ()

NcmMSetFunc *
nc_distance_create_mset_arrayfunc1 (NcDistance *dist,
                                    NcDistanceFunc1 f1,
                                    guint size);

FIXME

Parameters

dist

a NcDistance

 

f1

FIXME.

[scope notified]

size

array size

 

Returns

FIXME.

[transfer full]


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), $$ z_\star = 1048 \left(1 + 1.24 \times 10^{-3} (\Omega_b h^2)^{-0.738}\right) \left(1 + g_1 (\Omega_m h^2)^{g_2}\right),$$ where $\Omega_b h^2$ [nc_hicosmo_Omega_bh2()] and $\Omega_m h^2$ [nc_hicosmo_Omega_mh2()] 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_b h^2)^{-0.238}}{(1 + 39.5 (\Omega_b h^2)^{0.763})} \; \text{and} \; g_2 = \frac{0.56}{\left(1 + 21.1 (\Omega_b 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.

This function computes $z_d$ using the fitting formula given in Eisenstein & Hu (1998), $$z_d = \frac{1291 (\Omega_m h^2)^{0.251}}{(1 + 0.659 (\Omega_m h^2)^{0.828})} \left(1 + b_1 (\Omega_b h^2)^{b_2}\right),$$ where $\Omega_b h^2$ [nc_hicosmo_Omega_bh2()] and $\Omega_m h^2$ [nc_hicosmo_Omega_mh2()] 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_m h^2)^{-0.419} \left(1 + 0.607 (\Omega_m h^2)^{0.674}\right) \; \text{and} \; b_2 = 0.238 (\Omega_m 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 both computed at $z_\star$.

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

Returns

$l_A(z_\star)$


nc_distance_Omega_k ()

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

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);

$r(z_d)$.

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

Returns

FIXME


nc_distance_comoving ()

gdouble
nc_distance_comoving (NcDistance *dist,
                      NcHICosmo *cosmo,
                      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,
                        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,
                            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,
                        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,
                              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_modulus ()

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

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

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

z

redshift $z$

 

Returns

$\mu(z)$


nc_distance_luminosity_hef ()

gdouble
nc_distance_luminosity_hef (NcDistance *dist,
                            NcHICosmo *cosmo,
                            gdouble z_he,
                            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_modulus_hef ()

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

Calculate the distance modulus 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

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


nc_distance_shift_parameter ()

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

The shift parameter $R(z)$ is defined as \begin{align} R(z) &=& \frac{\sqrt{\Omega_m H_0^2}}{c} (1 + z) D_A(z) \ &=& \sqrt{\Omega_m} D_t(z), \end{align} where $\Omega_m$ is the matter density paremeter [nc_hicosmo_Omega_m()], $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,
                            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).

This function computes the adimensional 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,
                         gdouble z);

Bao 'A' scale D_v(z) sqrt(Omega_m) / z -- (arXiv:astro-ph/0501171) The acoustic scale is defined as $$ A \equiv D_V (z) \frac{\sqrt{\Omega_m H_0^2}}{z c},$$ where $\Omega_m$ is the matter density parameter [nc_hicosmo_Omega_m()], $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).

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,
                           gdouble z);

Compute the sound horizon $r_s$, \begin{equation} r_s (z) = \int_{z}^\infty \frac{c_s(z^\prime)}{E(z^\prime)} dz^\prime, \end{equation} where $c_s(z)$ is the speed of sound wave and $E(z)$ is the normalized Hubble function [nc_hicosmo_E()].

The integrand is given by \begin{equation}\label{eq:def:rs:integrand} \frac{c_s(z^\prime)}{H(z^\prime)} = \frac{1}{\sqrt{E(z^\prime)^2 (3 + \frac{9}{4} (1 + 0.2271 n_{eff}) \frac{\Omega_b}{\Omega_r (1 + z^\prime)})}}, \end{equation} where $n_{eff}$ is the effective number of neutrinos [ncm_c_neutrino_n_eff()], $\Omega_b$ [nc_hicosmo_Omega_b()] and $\Omega_r$ [nc_hicosmo_Omega_r()] are the baryonic and radiation density parameter, respectively. If $\Omega_r = 0$, the integrand returns 0.0.

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,
                               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(z) / E(z)$ is given by Eq. \eqref{eq:def:rs:integrand}.

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,
                      gdouble z);

$r(z_d) / D_V(z)$ -- (arXiv:0705.3323).

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

z

the redshift $z$

 

Returns

FIXME


nc_distance_DH_r ()

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

$H(z) / (c r_{z_d})$.

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

z

the redshift $z$

 

Returns

FIXME


nc_distance_DA_r ()

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

$D_A(z) / (c r_{z_d})$.

Parameters

dist

a NcDistance

 

cosmo

a NcHICosmo

 

z

the redshift $z$

 

Returns

FIXME


nc_distance_cosmic_time ()

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

nc_distance_lookback_time ()

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

nc_distance_conformal_time ()

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

nc_distance_conformal_lookback_time ()

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

nc_distance_cosmic_time_mks_scale ()

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

nc_distance_conformal_time_mks_scale ()

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

Types and Values

Property Details

The “zf” property

  “zf”                       gdouble

Final cached redshift.

Flags: Read / Write / Construct

Allowed values: >= 0

Default value: 10