NcmPowspecFilter

NcmPowspecFilter — Class to compute filtered power spectrum

Stability Level

Stable, unless otherwise indicated

Functions

Properties

double lnr0 Read / Write
guint max-k-knots Read / Write / Construct
guint max-z-knots Read / Write / Construct
NcmPowspec * powerspectrum Read / Write / Construct Only
double reltol Read / Write / Construct
double reltol-z Read / Write / Construct
NcmPowspecFilterType type Read / Write / Construct
double zf Read / Write
double zi Read / Write

Types and Values

Object Hierarchy

    GEnum
    ╰── NcmPowspecFilterType
    GObject
    ╰── NcmPowspecFilter

Includes

#include <numcosmo/math/ncm_powspec_filter.h>

Description

This class computes the filtered power spectrum, $\sigma^2(k, r)$, and its derivatives with respect to $\ln r$ (ncm_powspec_filter_eval_dnvar_dlnrn()) using the FFTLog approach (see NcmFftlog), \begin{equation}\label{eq:variance} \sigma^2(r, z) = \frac{1}{2\pi^2} \int_0^\infty k^2 \ P(k, z) \vert W(k,r) \vert^2 \ \mathrm{d}k, \end{equation} where $P(k, z)$ is the power spectrum at mode $k$ and redshift $z$ and $W(k, r)$ is the filter (or window function).

Functions

ncm_powspec_filter_new ()

NcmPowspecFilter *
ncm_powspec_filter_new (NcmPowspec *ps,
                        NcmPowspecFilterType type);

Creates a new NcmPowspecFilter from the power spectrum ps .

Parameters

ps

a NcmPowspec

 

type

a type from NcmPowspecFilterType

 

Returns

the newly created NcmPowspecFilter.

[transfer full]


ncm_powspec_filter_ref ()

NcmPowspecFilter *
ncm_powspec_filter_ref (NcmPowspecFilter *psf);

Increases the reference count of psf by one atomically.

Parameters

psf

a NcmPowspecFilter

 

Returns

psf .

[transfer full]


ncm_powspec_filter_free ()

void
ncm_powspec_filter_free (NcmPowspecFilter *psf);

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

Parameters

psf

a NcmPowspecFilter

 

ncm_powspec_filter_clear ()

void
ncm_powspec_filter_clear (NcmPowspecFilter **psf);

If psf is different from NULL, atomically decrements the reference count of psf by one. If the reference count drops to 0, all memory allocated by psf is released and psf is set to NULL.

Parameters

psf

a NcmPowspecFilter

 

ncm_powspec_filter_prepare ()

void
ncm_powspec_filter_prepare (NcmPowspecFilter *psf,
                            NcmModel *model);

Prepares the object applying the filter to the power spectrum.

Parameters

psf

a NcmPowspecFilter

 

model

a NcmModel

 

ncm_powspec_filter_prepare_if_needed ()

void
ncm_powspec_filter_prepare_if_needed (NcmPowspecFilter *psf,
                                      NcmModel *model);

Prepares (if necessary) the object applying the filter to the power spectrum.

Parameters

psf

a NcmPowspecFilter

 

model

a NcmModel

 

ncm_powspec_filter_set_type ()

void
ncm_powspec_filter_set_type (NcmPowspecFilter *psf,
                             NcmPowspecFilterType type);

Sets the type of the NcmPowspecFilter to be used.

Parameters

psf

a NcmPowspecFilter

 

type

a type from NcmPowspecFilterType

 

ncm_powspec_filter_set_lnr0 ()

void
ncm_powspec_filter_set_lnr0 (NcmPowspecFilter *psf,
                             gdouble lnr0);

Sets the center of the transform output $\ln(r_0)$ (see ncm_fftlog_set_lnr0()).

Parameters

psf

a NcmPowspecFilter

 

lnr0

the output center value $\ln(r_0)$

 

ncm_powspec_filter_set_best_lnr0 ()

void
ncm_powspec_filter_set_best_lnr0 (NcmPowspecFilter *psf);

Sets the value of $\ln(r_0)$ which gives the best results for the transformation based on the current value of $\ln(k_0)$.

Parameters

psf

a NcmPowspecFilter

 

ncm_powspec_filter_set_reltol ()

void
ncm_powspec_filter_set_reltol (NcmPowspecFilter *psf,
                               const gdouble reltol);

Sets the relative tolerance for calibration in the distance direction.

Parameters

psf

a NcmPowspecFilter

 

reltol

the relative tolerance for calibration

 

ncm_powspec_filter_set_reltol_z ()

void
ncm_powspec_filter_set_reltol_z (NcmPowspecFilter *psf,
                                 const gdouble reltol_z);

Sets the relative tolerance for calibration in the redshift direction.

Parameters

psf

a NcmPowspecFilter

 

reltol_z

the relative tolerance for calibration in the redshift direction

 

ncm_powspec_filter_set_zi ()

void
ncm_powspec_filter_set_zi (NcmPowspecFilter *psf,
                           gdouble zi);

Sets the inital time $z_i$.

Parameters

psf

a NcmPowspecFilter

 

zi

the output initial time $z_i$

 

ncm_powspec_filter_set_zf ()

void
ncm_powspec_filter_set_zf (NcmPowspecFilter *psf,
                           gdouble zf);

Sets the final time $z_f$.

Parameters

psf

a NcmPowspecFilter

 

zf

the output final time $z_f$

 

ncm_powspec_filter_require_zi ()

void
ncm_powspec_filter_require_zi (NcmPowspecFilter *psf,
                               gdouble zi);

Require the initial time of at least $z_i$.

Parameters

psf

a NcmPowspecFilter

 

zi

the output initial time $z_i$

 

ncm_powspec_filter_require_zf ()

void
ncm_powspec_filter_require_zf (NcmPowspecFilter *psf,
                               gdouble zf);

Requires the final time of at least $z_f$.

Parameters

psf

a NcmPowspecFilter

 

zf

the output final time $z_f$

 

ncm_powspec_filter_get_filter_type ()

NcmPowspecFilterType
ncm_powspec_filter_get_filter_type (NcmPowspecFilter *psf);

Gets the type of filter used.

Parameters

psf

a NcmPowspecFilter

 

Returns

the type of filter used.


ncm_powspec_filter_get_reltol ()

gdouble
ncm_powspec_filter_get_reltol (NcmPowspecFilter *psf);

Gets the relative tolerance for calibration in the distance direction.

Parameters

psf

a NcmPowspecFilter

 

Returns

the relative tolerance for calibration in the distance direction.


ncm_powspec_filter_get_reltol_z ()

gdouble
ncm_powspec_filter_get_reltol_z (NcmPowspecFilter *psf);

Gets the relative tolerance for calibration in the redshift direction.

Parameters

psf

a NcmPowspecFilter

 

Returns

the relative tolerance for calibration in the redshift direction.


ncm_powspec_filter_get_r_min ()

gdouble
ncm_powspec_filter_get_r_min (NcmPowspecFilter *psf);

This function returns $\sigma^2(r, z)$'s minimum evaluated distance.

Parameters

psf

a NcmPowspecFilter

 

Returns

the minimum distance $r_{\mathrm{min}}$.


ncm_powspec_filter_get_r_max ()

gdouble
ncm_powspec_filter_get_r_max (NcmPowspecFilter *psf);

This function returns $\sigma^2(r, z)$'s maximum evaluated distance.

Parameters

psf

a NcmPowspecFilter

 

Returns

the maximum distance $r_{\mathrm{max}}$.


ncm_powspec_filter_eval_lnvar_lnr ()

gdouble
ncm_powspec_filter_eval_lnvar_lnr (NcmPowspecFilter *psf,
                                   const gdouble z,
                                   const gdouble lnr);

Evaluates the logarithm base e of the filtered power spectrum at lnr and z .

Parameters

psf

a NcmPowspecFilter

 

z

redshift $z$

 

lnr

logarithm base e of $r$

 

Returns

$\ln \left[ \sigma^2(\ln r, z) \right]$.


ncm_powspec_filter_eval_var ()

gdouble
ncm_powspec_filter_eval_var (NcmPowspecFilter *psf,
                             const gdouble z,
                             const gdouble r);

Evaluate the filtered variance at $r$.

Parameters

psf

a NcmPowspecFilter

 

z

redshift $z$

 

r

distance $r$

 

Returns

$\sigma^2(r, z)$.


ncm_powspec_filter_eval_var_lnr ()

gdouble
ncm_powspec_filter_eval_var_lnr (NcmPowspecFilter *psf,
                                 const gdouble z,
                                 const gdouble lnr);

Evaluates the filtered power spectrum at lnr and z .

Parameters

psf

a NcmPowspecFilter

 

z

redshift $z$

 

lnr

logarithm base e of $r$

 

Returns

$\sigma^2(\ln r, z)$.


ncm_powspec_filter_eval_sigma_lnr ()

gdouble
ncm_powspec_filter_eval_sigma_lnr (NcmPowspecFilter *psf,
                                   const gdouble z,
                                   const gdouble lnr);

Evaluate the square root of the filtered power spectrum at lnr and z .

Parameters

psf

a NcmPowspecFilter

 

z

redshift $z$

 

lnr

logarithm base e of $r$

 

Returns

$\sqrt{ \sigma^2(\ln r, z) }$.


ncm_powspec_filter_eval_sigma ()

gdouble
ncm_powspec_filter_eval_sigma (NcmPowspecFilter *psf,
                               const gdouble z,
                               const gdouble r);

Evaluates the square root of the filtered power spectrum at r and z .

Parameters

psf

a NcmPowspecFilter

 

z

redshift $z$

 

r

distance $r$

 

Returns

$\sqrt{ \sigma^2(r, z) }$.


ncm_powspec_filter_eval_dvar_dlnr ()

gdouble
ncm_powspec_filter_eval_dvar_dlnr (NcmPowspecFilter *psf,
                                   const gdouble z,
                                   const gdouble lnr);

Evaluates the first derivative of the filtered variance with respect to $\ln r$ at lnr and z .

Parameters

psf

a NcmPowspecFilter

 

z

redshift $z$

 

lnr

logarithm base e of $r$

 

Returns

$\frac{\mathrm{d} \sigma^2(\ln r, z) }{\mathrm{d} \ln r }$.


ncm_powspec_filter_eval_dlnvar_dlnr ()

gdouble
ncm_powspec_filter_eval_dlnvar_dlnr (NcmPowspecFilter *psf,
                                     const gdouble z,
                                     const gdouble lnr);

Evaluates the first derivative of the logarithm of the filtered variance with respect to $\ln r$ at lnr and z .

Parameters

psf

a NcmPowspecFilter

 

z

redshift $z$

 

lnr

logarithm base e of $r$

 

Returns

$\frac{\mathrm{d} \left[ \ln \sigma^2(\ln r, z) \right] }{\mathrm{d} \ln r }$.


ncm_powspec_filter_eval_dlnvar_dr ()

gdouble
ncm_powspec_filter_eval_dlnvar_dr (NcmPowspecFilter *psf,
                                   const gdouble z,
                                   const gdouble lnr);

Evaluates the first derivative of the logarithm of the filtered variance with respect to $r$ at lnr and z .

Parameters

psf

a NcmPowspecFilter

 

z

redshift $z$

 

lnr

logarithm base e of $r$

 

Returns

$\frac{\mathrm{d} \left[ \ln \sigma^2(\ln r, z) \right] }{\mathrm{d} r }$.


ncm_powspec_filter_eval_dnvar_dlnrn ()

gdouble
ncm_powspec_filter_eval_dnvar_dlnrn (NcmPowspecFilter *psf,
                                     const gdouble z,
                                     const gdouble lnr,
                                     guint n);

Evaluates the derivatives of the filtered variance at lnr and z , namely:

  • $n = 0 \rightarrow \sigma(r, z)^2$,

  • $n = 1 \rightarrow \frac{\mathrm{d}\sigma^2}{\mathrm{d} \ln r}$,

  • $n = 2 \rightarrow \frac{\mathrm{d}^2\sigma^2}{\mathrm{d}(\ln r)^2}$,

  • $n = 3 \rightarrow \frac{\mathrm{d}^3\sigma^2}{\mathrm{d}(\ln r)^3}$.

Parameters

psf

a NcmPowspecFilter

 

z

redshift $z$

 

lnr

logarithm base e of $r$

 

n

number of derivatives $n$

 

Returns

one of the four derivatives described above.


ncm_powspec_filter_eval_dnlnvar_dlnrn ()

gdouble
ncm_powspec_filter_eval_dnlnvar_dlnrn (NcmPowspecFilter *psf,
                                       const gdouble z,
                                       const gdouble lnr,
                                       guint n);

Evaluates the derivatives of the logarithm of the filtered variance at lnr and z , namely:

  • $n = 0 \rightarrow \ln \left[ \sigma(r, z)^2 \right]$,

  • $n = 1 \rightarrow \frac{\mathrm{d}\ln \left( \sigma^2 \right)}{\mathrm{d} \ln r}$,

  • $n = 2 \rightarrow \frac{\mathrm{d}^2 \ln \left( \sigma^2 \right)}{\mathrm{d}(\ln r)^2}$,

  • $n = 3 \rightarrow \frac{\mathrm{d}^3 \ln \left( \sigma^2 \right)}{\mathrm{d}(\ln r)^3}$.

Parameters

psf

a NcmPowspecFilter

 

z

redshift $z$

 

lnr

logarithm base e of $r$

 

n

number of derivatives $n$

 

Returns

one of the four derivatives described above.


ncm_powspec_filter_volume_rm3 ()

gdouble
ncm_powspec_filter_volume_rm3 (NcmPowspecFilter *psf);

Calculates the volume of the filter over $r^3$.

Parameters

psf

a NcmPowspecFilter

 

Returns

Filter's volume over the radius squared $V r^{-3}$.


ncm_powspec_filter_peek_powspec ()

NcmPowspec *
ncm_powspec_filter_peek_powspec (NcmPowspecFilter *psf);

Gets the NcmPowspec object used to compute the filtered variance $\sigma^{2}(r,z)$.

Parameters

psf

a NcmPowspecFilter

 

Returns

the NcmPowspec object.

[transfer none]

Types and Values

NCM_TYPE_POWSPEC_FILTER

#define NCM_TYPE_POWSPEC_FILTER (ncm_powspec_filter_get_type ())

enum NcmPowspecFilterType

Filter type to apply to the power spectrum. See also NcmFftlogTophatwin2 and NcmFftlogGausswin2, for the top-hat and Gaussian filters, respectively.

Members

NCM_POWSPEC_FILTER_TYPE_TOPHAT

Apply the top-hat filter.

 

NCM_POWSPEC_FILTER_TYPE_GAUSS

Apply the Gaussian filter.

 

NCM_POWSPEC_FILTER_DEFAULT_SIZE

#define NCM_POWSPEC_FILTER_DEFAULT_SIZE (200)

NcmPowspecFilter

typedef struct _NcmPowspecFilter NcmPowspecFilter;

Property Details

The “lnr0” property

  “lnr0”                     double

The output center value for $\ln(r)$.

Owner: NcmPowspecFilter

Flags: Read / Write

Default value: 0


The “max-k-knots” property

  “max-k-knots”              guint

The maximum number of knots in the k direction.

Owner: NcmPowspecFilter

Flags: Read / Write / Construct

Default value: 10000


The “max-z-knots” property

  “max-z-knots”              guint

The maximum number of knots in the redshift direction.

Owner: NcmPowspecFilter

Flags: Read / Write / Construct

Default value: 1000


The “powerspectrum” property

  “powerspectrum”            NcmPowspec *

The NcmPowspec object to be used to compute the variance $\sigma^{2}(r,z)$.

Owner: NcmPowspecFilter

Flags: Read / Write / Construct Only


The “reltol” property

  “reltol”                   double

The relative tolerance for calibration in the distance direction.

Owner: NcmPowspecFilter

Flags: Read / Write / Construct

Allowed values: [2.22045e-16,1]

Default value: 0.001


The “reltol-z” property

  “reltol-z”                 double

The relative tolerance for calibration in the redshift direction.

Owner: NcmPowspecFilter

Flags: Read / Write / Construct

Allowed values: [2.22045e-16,1]

Default value: 1e-06


The “type” property

  “type”                     NcmPowspecFilterType

The type of fliter used $W(k,r)$.

Owner: NcmPowspecFilter

Flags: Read / Write / Construct

Default value: NCM_POWSPEC_FILTER_TYPE_TOPHAT


The “zf” property

  “zf”                       double

The output final time $z_f$ of the variance $\sigma^{2}(r,z)$.

Owner: NcmPowspecFilter

Flags: Read / Write

Default value: 1


The “zi” property

  “zi”                       double

The output initial time $z_i$ of the variance $\sigma^{2}(r,z)$.

Owner: NcmPowspecFilter

Flags: Read / Write

Default value: 0