Top |
NcmPowspec * | ncm_powspec_ref () |
void | ncm_powspec_free () |
void | ncm_powspec_clear () |
void | ncm_powspec_set_zi () |
void | ncm_powspec_set_zf () |
void | ncm_powspec_set_kmin () |
void | ncm_powspec_set_kmax () |
void | ncm_powspec_set_reltol_spline () |
void | ncm_powspec_require_zi () |
void | ncm_powspec_require_zf () |
void | ncm_powspec_require_kmin () |
void | ncm_powspec_require_kmax () |
gdouble | ncm_powspec_get_zi () |
gdouble | ncm_powspec_get_zf () |
gdouble | ncm_powspec_get_kmin () |
gdouble | ncm_powspec_get_kmax () |
gdouble | ncm_powspec_get_reltol_spline () |
void | ncm_powspec_get_nknots () |
void | ncm_powspec_prepare () |
void | ncm_powspec_prepare_if_needed () |
gdouble | ncm_powspec_eval () |
void | ncm_powspec_eval_vec () |
NcmSpline2d * | ncm_powspec_get_spline_2d () |
NcmModelCtrl * | ncm_powspec_peek_model_ctrl () |
gdouble | ncm_powspec_var_tophat_R () |
gdouble | ncm_powspec_sigma_tophat_R () |
gdouble | ncm_powspec_corr3d () |
gdouble | ncm_powspec_sproj () |
This module comprises the set of functions to compute a power spectrum and derived quantities.
Given a field $\delta(\vec{x})$ at position $\vec{x}$, the power spectrum is defined as the Fourier transform of the two-point correlation point, i.e., $$\xi(\vec{x} - \vec{x}^\prime) = \int \frac{d^3 k}{(2 \pi)^3} e^{i \vec{k}.(\vec{x} - \vec{x}^\prime)} P(k),$$ where $\langle \delta(\vec{k} - \vec{k}^\prime)\rangle = (2\pi)^3 \delta_D(\vec{k} - \vec{k}^\prime) P(k)$ and $\delta_D$ is the Dirac's delta function. The standard output is the dimensional power spectrum, not the dimensionless one $\Delta(k)^2$, $$P(k) \equiv \frac{2 \pi^2 \Delta(k)^2}{k^3}.$$
NcmPowspec *
ncm_powspec_ref (NcmPowspec *powspec
);
Increases the reference count of powspec
by one atomically.
void
ncm_powspec_free (NcmPowspec *powspec
);
Atomically decrements the reference count of powspec
by one.
If the reference count drops to 0,
all memory allocated by powspec
is released.
void
ncm_powspec_clear (NcmPowspec **powspec
);
If powspec
is different from NULL,
atomically decrements the reference count of powspec
by one.
If the reference count drops to 0,
all memory allocated by powspec
is released and powspec
is set to NULL.
void ncm_powspec_set_zi (NcmPowspec *powspec
,const gdouble zi
);
Sets the initial time $z_i$.
void ncm_powspec_set_zf (NcmPowspec *powspec
,const gdouble zf
);
Sets the final time $z_f$.
void ncm_powspec_set_kmin (NcmPowspec *powspec
,const gdouble kmin
);
Sets the minimum mode value $k_\mathrm{min}$.
void ncm_powspec_set_kmax (NcmPowspec *powspec
,const gdouble kmax
);
Sets the maximum mode value $k_\mathrm{max}$.
void ncm_powspec_set_reltol_spline (NcmPowspec *powspec
,const gdouble reltol
);
Sets the relative tolerance for interpolation errors to reltol
.
void ncm_powspec_require_zi (NcmPowspec *powspec
,const gdouble zi
);
Requires the initial time to be less or equal to $z_i$.
void ncm_powspec_require_zf (NcmPowspec *powspec
,const gdouble zf
);
Requires the final time to be greater or equal to $z_f$.
void ncm_powspec_require_kmin (NcmPowspec *powspec
,const gdouble kmin
);
Requires the minimum mode value to be less or equal to $k_\mathrm{min}$.
void ncm_powspec_require_kmax (NcmPowspec *powspec
,const gdouble kmax
);
Sets the maximum mode value $k_\mathrm{max}$.
gdouble
ncm_powspec_get_zi (NcmPowspec *powspec
);
Gets the initial value $z_i$.
gdouble
ncm_powspec_get_kmin (NcmPowspec *powspec
);
Gets the minimum mode value $k_\mathrm{min}$.
gdouble
ncm_powspec_get_kmax (NcmPowspec *powspec
);
Gets the maximum mode value $k_\mathrm{max}$.
gdouble
ncm_powspec_get_reltol_spline (NcmPowspec *powspec
);
Gets the relative tolerance for interpolation errors.
void ncm_powspec_get_nknots (NcmPowspec *powspec
,guint *Nz
,guint *Nk
);
Gets the number of knots used to calculate the power spectrum.
[virtual get_nknots]
void ncm_powspec_prepare (NcmPowspec *powspec
,NcmModel *model
);
Prepares the power spectrum powspec
using the model model
.
void ncm_powspec_prepare_if_needed (NcmPowspec *powspec
,NcmModel *model
);
Prepares the object powspec
using the model model
if it was changed
since last preparation.
gdouble ncm_powspec_eval (NcmPowspec *powspec
,NcmModel *model
,const gdouble z
,const gdouble k
);
Evaluates the power spectrum powspec
at $(z, k)$.
void ncm_powspec_eval_vec (NcmPowspec *powspec
,NcmModel *model
,const gdouble z
,NcmVector *k
,NcmVector *Pk
);
Evaluates the power spectrum powspec
at $z$ and in the knots
contained in k
and puts the result in Pk
.
NcmSpline2d * ncm_powspec_get_spline_2d (NcmPowspec *powspec
,NcmModel *model
);
Compute a 2D spline for the power spectrum.
NcmModelCtrl *
ncm_powspec_peek_model_ctrl (NcmPowspec *powspec
);
Gets the NcmModelCtrl used by powspec
.
gdouble ncm_powspec_var_tophat_R (NcmPowspec *powspec
,NcmModel *model
,const gdouble reltol
,const gdouble z
,const gdouble R
);
This function computes the value of the linearly extrapolated rms fluctuations of mass in a sphere of radius $R$ applying a top-hat filter at redshift $z$, $$\sigma_{R}^{2}(z) = \frac{1}{2\pi^2} \int_{k_{\mathrm{min}}}^{k_\mathrm{max}} W^{2}_{TH}(kR) \, P(k,z) \, k^2 \, \mathrm{d}k \, .$$ Where, $W_{TH}(t)$ is the top-hat filter in Fourier space, $$W_{TH}(t) = \frac{3}{t^3} \left( \sin t - t \cos t \right) = \frac{3}{t} j_{1}(t),$$ and $j_1(t)$ is the first order spherical Bessel function of the first kind. This function is recommended for a small set of $z$ and $R$ values. For a wide range of values it is best to apply NcmPowspecFilter, instead.
powspec |
||
model |
a NcmModel. |
[allow-none] |
reltol |
relative tolerance for integration |
|
z |
the value of $z$ |
|
R |
the value of $R$ |
gdouble ncm_powspec_sigma_tophat_R (NcmPowspec *powspec
,NcmModel *model
,const gdouble reltol
,const gdouble z
,const gdouble R
);
Computes $\sigma_R(z) = \sqrt{\sigma_{R}^{2}(z)}$. See ncm_powspec_var_tophat_R()
.
powspec |
||
model |
a NcmModel. |
[allow-none] |
reltol |
relative tolerance for integration |
|
z |
the value of $z$ |
|
R |
the value of $R$ |
gdouble ncm_powspec_corr3d (NcmPowspec *powspec
,NcmModel *model
,const gdouble reltol
,const gdouble z
,const gdouble r
);
Computes the spatial correlation function in configuration space at redshift $z$ and position $r$, $$\xi(r,z) = \frac{1}{2\pi^2} \int_{k_{\mathrm{min}}}^{k_\mathrm{max}} P(k,z) \, j_{0}(kr) \, k^2 \, \mathrm{d}k \, ,$$ where, $j_0(t)$ is the zero order spherical Bessel function of the first kind. This function is recommended for a small set of $r$ and $z$ values. For a wide range of values it is best to apply NcmPowspecCorr3d, instead.
powspec |
||
model |
a NcmModel. |
[allow-none] |
reltol |
relative tolerance for integration |
|
z |
the value of $z$ |
|
r |
the value of $r$ |
gdouble ncm_powspec_sproj (NcmPowspec *powspec
,NcmModel *model
,const gdouble reltol
,const gint ell
,const gdouble z1
,const gdouble z2
,const gdouble xi1
,const gdouble xi2
);
Computes (C_\ell (z_1, z_2) = \int\dots). This method calculates the angular power spectrum directly from the power spectrum by integrating over the wave-numbers. It is slow and intended for testing purposes only.
powspec |
||
model |
a NcmModel. |
[allow-none] |
reltol |
relative tolerance for integration |
|
ell |
the value of $\ell$ |
|
z1 |
the value of $z_1$ |
|
z2 |
the value of $z_2$ |
|
xi1 |
the value of $\xi_1$ |
|
xi2 |
the value of $\xi_2$ |
“kmax”
property “kmax” double
The maximum mode (wave-number) value to compute $P(k,z)$.
Owner: NcmPowspec
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 1
“kmin”
property “kmin” double
The minimum mode (wave-number) value to compute $P(k,z)$.
Owner: NcmPowspec
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 1e-05
“reltol”
property “reltol” double
The relative tolerance on the interpolation error.
Owner: NcmPowspec
Flags: Read / Write / Construct
Allowed values: [2.22045e-16,1]
Default value: 1.49012e-08
“zf”
property “zf” double
The final time (redshift) to compute $P(k,z)$.
Owner: NcmPowspec
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 1