swiftcl package

Submodules

Module contents

class swiftcl.ClComp(**kwargs)[source]

Bases: object

A class to compute the angular power spectrum given the power spectrum and the window function.

z1

Redshift endpoints of the window function of the first contribution.

Type:

np.ndarray

z2

Redshift endpoints of the window function of the second contribution.

Type:

np.ndarray

l

Values of multipole moment l to compute.

Type:

jnp.ndarray

k

Values of wave number k to integrate over.

Type:

jnp.ndarray

contr1

First probe for the computation of the power spectrum. Can be one of ‘g’, ‘mag’, ‘RSD’, ‘f_NL’, ‘g,mag’, ‘g,RSD’, ‘g,mag,RSD’, ‘g,f_NL’, ‘wl’, ‘CMB_k’, ‘CMB_T’, ‘intjl’, ‘intjl/k^2’ or ‘intddjl’. Defaults to ‘g’.

Type:

str, optional

contr2

Second probe for the computation of the power spectrum. Can be one of ‘g’, ‘mag’, ‘RSD’, ‘f_NL’, ‘g,mag’, ‘g,RSD’, ‘g,mag,RSD’, ‘g,f_NL’, ‘wl’, ‘CMB_k’, or ‘CMB_T’, ‘intjl’, ‘intjl/k^2’ or ‘intddjl’. Defaults to ‘g’.

Type:

str, optional

jit

Enables just-in-time compilation. Defaults to False.

Type:

bool, optional

N

Maximum number of points for the FFTLog of the window function. Defaults to 512.

Type:

int, optional

bias

Bias for the FFTLog. Must be between 0 and 1. Defaults to 0.01.

Type:

float, optional

wind

Smoothing parameter for the window function. Defaults to 0.2.

Type:

float, optional

N_interp

Number of points for interpolation along k. Defaults to 100.

Type:

int, optional

path

Path to save the g_r files. Defaults to the current working directory.

Type:

str, optional

C_l(n1, n2, chis1, chis2, D1, D2, P, H1=1.0, H2=1.0, H0=1.0, O_m=1.0, f1=1.0, f2=1.0, T1=1.0, T2=1.0, C_g1=1.0, C_g2=1.0, b_g1=1.0, b_g2=1.0, b_fNL1=1.0, b_fNL2=1.0, f_NL1=1.0, f_NL2=1.0, A_IA1=0.0, A_IA2=0.0, chi_ls=13873.39)[source]

Compute the angular power spectrum assuming a scale-dependent growth factor.

Parameters:
  • n1 (np.ndarray) – Redshift distribution for the first probe. A 2D array where n1[:,0] is redshift z and n1[:,1] is the probability density p(z).

  • n2 (np.ndarray) – Redshift distribution for the second probe, same format as n1.

  • chis1 (np.ndarray) – Comoving distance χ(z) evaluated at n1[:,0].

  • chis2 (np.ndarray) – Comoving distance χ(z) evaluated at n2[:,0].

  • D1 (np.ndarray) – Growth factor D(z, k) for the first probe.

  • D2 (np.ndarray) – Growth factor D(z, k) for the second probe.

  • P (np.ndarray) – Power spectrum P(k, z0) at a fiducial redshift z0.

  • H1 (np.ndarray) – Hubble parameter H(z) evaluated at n1[:,0] (needed for ‘g’ contribution).

  • H2 (np.ndarray) – Hubble parameter H(z) evaluated at n2[:,0] (needed for ‘g’ contribution).

  • H0 (float, optional) – Hubble parameter at z=0. Required for ‘mag’ and ‘wl’ contributions. Defaults to 1.

  • O_m (float, optional) – Matter density parameter Ω_m. Required for ‘mag’ and ‘wl’ contributions. Defaults to 1.

  • f1 (np.ndarray, optional) – Logarithmic growth rate f(z) at n1[:,0]. Required for ‘RSD’. Defaults to 1.

  • f2 (np.ndarray, optional) – Logarithmic growth rate f(z) at n2[:,0]. Required for ‘RSD’. Defaults to 1.

  • T1 (np.ndarray, optional) – Matter transfer function T(z,k) for the first probe. Required for ‘f_NL’. Defaults to 1.

  • T2 (np.ndarray, optional) – Matter transfer function T(z,k) for the second probe. Required for ‘f_NL’. Defaults to 1.

  • C_g1 (float, optional) – Magnification bias coefficient for the first probe. Defaults to 1.

  • C_g2 (float, optional) – Magnification bias coefficient for the second probe. Defaults to 1.

  • b_g1 (float, optional) – Galaxy bias for the first probe. Defaults to 1.

  • b_g2 (float, optional) – Galaxy bias for the second probe. Defaults to 1.

  • b_fNL1 (float, optional) – Non-Gaussian bias parameter for the first probe, (b_1^{f_{NL}}). Defaults to 1.

  • b_fNL2 (float, optional) – Non-Gaussian bias parameter for the second probe, (b_1^{f_{NL}}). Defaults to 1.

  • f_NL1 (float, optional) – Primordial non-Gaussianity parameter for the first probe. Defaults to 1.

  • f_NL2 (float, optional) – Primordial non-Gaussianity parameter for the second probe. Defaults to 1.

  • A_IA1 (np.ndarray, optional) – Intrinsic alignment amplitude for the first probe, evaluated at n1[:,0]. Defaults to 0.

  • A_IA2 (np.ndarray, optional) – Intrinsic alignment amplitude for the second probe, evaluated at n2[:,0]. Defaults to 0.

Returns:

Angular power spectrum (C_ell) as a 1D array.

Return type:

np.ndarray

c_int(xmin, xmax)[source]
set_config(option, default)[source]
w_CMB_T(chis, H, f, D)[source]
w_CMB_k(n, chis, D, chi_ls)[source]
w_RSD(n, H, f, D)[source]
w_fnl(n, H, T, D)[source]
w_g(n, H, D)[source]
w_k(n, chis, D)[source]
w_wl(n, chis, H, H0, O_m, A_IA, D)[source]
window(contr, n, chis, H, H0, O_m, f, T, D, C_g, b_g, b_fNL, f_NL, A_IA, chi_ls)[source]