API Reference

Blackbody Physics Functions

CMBForegrounds.dimensionless_freq_varsFunction
dimensionless_freq_vars(ν, ν0, T)

Calculates dimensionless frequency variables used in blackbody-related calculations.

The variables are defined as:

  • $r = \nu / \nu_0$
  • $x = \frac{h\nu}{k_B T}$
  • $x_0 = \frac{h\nu_0}{k_B T}$

where $h$ is the Planck constant and $k_B$ is the Boltzmann constant.

Arguments

  • ν: Frequency in GHz
  • ν0: Reference frequency in GHz
  • T: Temperature in Kelvin

Returns

  • A tuple (r, x, x0) containing the dimensionless variables
source
CMBForegrounds.Bnu_ratioFunction
Bnu_ratio(ν, ν0, T)

Computes the ratio of Planck blackbody intensities at two frequencies.

The Planck function ratio is:

\[\frac{B(\nu, T)}{B(\nu_0, T)} = \left(\frac{\nu}{\nu_0}\right)^3 \frac{\exp(h\nu_0/k_B T) - 1}{\exp(h\nu/k_B T) - 1}\]

Arguments

  • ν: Frequency in GHz
  • ν0: Reference frequency in GHz
  • T: Temperature in Kelvin

Returns

  • Dimensionless ratio B(ν, T) / B(ν0, T)
source
CMBForegrounds.dBdT_ratioFunction
dBdT_ratio(ν, ν0, T)

Computes the ratio of blackbody temperature derivatives at two frequencies.

The derivative ratio is:

\[\frac{\partial B(\nu, T)/\partial T}{\partial B(\nu_0, T)/\partial T} = \left(\frac{\nu}{\nu_0}\right)^4 \frac{x_0^2 \exp(x_0)/(\exp(x_0) - 1)^2}{x^2 \exp(x)/(\exp(x) - 1)^2}\]

where $x = h\nu/(k_B T)$ and $x_0 = h\nu_0/(k_B T)$.

Arguments

  • ν: Frequency in GHz
  • ν0: Reference frequency in GHz
  • T: Temperature in Kelvin

Returns

  • Dimensionless ratio (∂B/∂T)(ν, T) / (∂B/∂T)(ν0, T)
source

Thermal Sunyaev-Zel'dovich Functions

CMBForegrounds.tsz_g_ratioFunction
tsz_g_ratio(ν, ν0, T)

Calculates the spectral shape of the thermal Sunyaev-Zel'dovich (tSZ) effect.

The tSZ spectral function is:

\[g(x) = x \coth\left(\frac{x}{2}\right) - 4\]

where $x = h\nu/(k_B T)$. This function returns $g(x) / g(x_0)$.

Arguments

  • ν: Frequency in GHz
  • ν0: Reference frequency in GHz
  • T: CMB temperature in Kelvin

Returns

  • Dimensionless ratio g(ν) / g(ν0) of tSZ spectral function
source
CMBForegrounds.tsz_cross_powerFunction
tsz_cross_power(template, A_tSZ, ν1, ν2, ν0, α_tSZ, ℓ_pivot, ℓs; T_CMB=T_CMB)

Computes the thermal Sunyaev-Zel'dovich cross-power spectrum.

The tSZ power spectrum is:

\[D_\ell^{\mathrm{tSZ}}(\nu_1, \nu_2) = A_{\mathrm{tSZ}} \cdot g(\nu_1) \cdot g(\nu_2) \cdot T(\ell) \cdot \left(\frac{\ell}{\ell_{\mathrm{pivot}}}\right)^{\alpha_{\mathrm{tSZ}}}\]

where $T(\ell)$ is the template and $g(\nu)$ is the tSZ spectral function.

Arguments

  • template: tSZ power spectrum template Dℓ at reference frequency
  • A_tSZ: tSZ amplitude at pivot scale
  • ν1, ν2: Frequencies in GHz of correlated channels
  • ν0: Reference frequency in GHz
  • α_tSZ: Power-law tilt of tSZ spectrum
  • ℓ_pivot: Pivot multipole for power-law scaling
  • ℓs: Multipoles for computation

Keywords

  • T_CMB=T_CMB: CMB temperature in Kelvin

Returns

  • tSZ cross-power spectrum Dℓ
source
CMBForegrounds.tsz_cib_cross_powerFunction
tsz_cib_cross_power(ℓs, ξ, A_tSZ, A_CIB, α, β, z1, z2, ν_cib1, ν_cib2, ν_tsz1, ν_tsz2, α_tsz, tsz_template, ν0_tsz, Tdust, ν0_cib; ℓ_pivot_cib=3000, ℓ_pivot_tsz=3000, T_CMB=T_CMB)

Computes the cross-correlation between thermal SZ and cosmic infrared background.

The tSZ-CIB cross-power spectrum is:

\[D_\ell^{\mathrm{tSZ \times CIB}} = -\xi \left( \sqrt{|D_\ell^{\mathrm{tSZ,11}} \cdot D_\ell^{\mathrm{CIB,22}}|} + \sqrt{|D_\ell^{\mathrm{tSZ,22}} \cdot D_\ell^{\mathrm{CIB,11}}|} \right)\]

where $\xi$ is the correlation coefficient and auto-spectra are computed for each component.

Arguments

  • ℓs: Vector of multipoles.
  • ξ: tSZ-CIB correlation coefficient.
  • A_tSZ, A_CIB: Amplitudes for the tSZ and CIB power spectra.
  • α, β: Power-law indices for the CIB model.
  • z1, z2: Redshifts for the CIB channels.
  • ν_cib1, ν_cib2: Frequencies for the CIB channels.
  • ν_tsz1, ν_tsz2: Frequencies for the tSZ channels.
  • α_tsz: The power-law tilt of the tSZ power spectrum.
  • tsz_template: Power spectrum template for the tSZ effect.
  • ν0_tsz, ν0_cib: Reference frequencies for the tSZ and CIB models.
  • Tdust: Dust temperature for the CIB model.

Keywords

  • ℓ_pivot_cib: Pivot multipole for the CIB power spectrum; default is 3000.
  • ℓ_pivot_tsz: Pivot multipole for the tSZ power spectrum; default is 3000.
  • T_CMB: Temperature of the CMB.

Returns

  • An AbstractVector of the tSZ-CIB cross-power spectrum Dℓ.
source

CIB and Dust Functions

CMBForegrounds.cib_mbb_sed_weightFunction
cib_mbb_sed_weight(β, Tdust, ν0, ν; T_CMB=T_CMB)

Calculates the spectral energy distribution weight for modified blackbody emission.

The CIB modified blackbody SED weight is:

\[S(\nu) = \left(\frac{\nu}{\nu_0}\right)^\beta \frac{B(\nu, T_\mathrm{dust})}{B(\nu_0, T_\mathrm{dust})} \frac{(\partial B/\partial T)(\nu_0, T_\mathrm{CMB})}{(\partial B/\partial T)(\nu, T_\mathrm{CMB})}\]

where $B(\nu, T)$ is the Planck function and $\beta$ is the dust emissivity index.

Arguments

  • β: Dust emissivity spectral index
  • Tdust: Dust temperature in Kelvin
  • ν0: Reference frequency in GHz
  • ν: Evaluation frequency in GHz

Keywords

  • T_CMB=T_CMB: CMB temperature in Kelvin

Returns

  • Dimensionless SED weight
source
CMBForegrounds.dust_tt_power_lawFunction
dust_tt_power_law(ℓs, A_pivot, α, β, ν1, ν2, Tdust, ν0; ℓ_pivot=80, T_CMB=T_CMB)

Computes thermal dust power spectrum using a power-law model.

The dust power spectrum is:

\[D_\ell^{\mathrm{dust}}(\nu_1, \nu_2) = A_{\mathrm{pivot}} \cdot S(\nu_1) \cdot S(\nu_2) \cdot \left(\frac{\ell}{\ell_{\mathrm{pivot}}}\right)^{\alpha + 2}\]

where $S(\nu)$ is the modified blackbody SED weight and the $+2$ converts from $C_\ell$ to $D_\ell$ scaling.

Arguments

  • ℓs: Multipoles vector
  • A_pivot: Amplitude at pivot multipole
  • α: Power-law index for multipole dependence
  • β: Dust emissivity spectral index
  • ν1, ν2: Frequencies in GHz for cross-correlation
  • Tdust: Dust temperature in Kelvin
  • ν0: Reference frequency in GHz

Keywords

  • ℓ_pivot=80: Pivot multipole
  • T_CMB=T_CMB: CMB temperature

Returns

  • Dust power spectrum Dℓ
source
CMBForegrounds.cib_clustered_powerFunction
cib_clustered_power(ℓs, A_CIB, α, β, ν1, ν2, z1, z2, Tdust, ν0_cib; ℓ_pivot=3000, T_CMB=T_CMB)

Computes the clustered cosmic infrared background power spectrum.

The CIB clustered power spectrum is:

\[D_\ell^{\mathrm{CIB}}(\nu_1, \nu_2) = A_{\mathrm{CIB}} \cdot S(\nu_1) \cdot S(\nu_2) \cdot \sqrt{z_1 z_2} \cdot \left(\frac{\ell}{\ell_{\mathrm{pivot}}}\right)^\alpha\]

where $S(\nu)$ are the modified blackbody SED weights and $z_i$ are redshift factors.

This function handles both auto-spectra (when ν1=ν2 and z1=z2) and cross-spectra.

Arguments

  • ℓs: An AbstractVector of multipoles.
  • A_CIB: Amplitude of the CIB power spectrum at the pivot multipole.
  • α: Power-law index for the multipole dependence.
  • β: Spectral index for the dust emissivity (modified blackbody).
  • ν1: First frequency in GHz.
  • ν2: Second frequency in GHz.
  • z1: First redshift factor (related to flux normalization).
  • z2: Second redshift factor (related to flux normalization).
  • Tdust: Dust temperature in Kelvin.
  • ν0_cib: Reference frequency for the CIB SED in GHz.

Keywords

  • ℓ_pivot: Pivot multipole where amplitude is defined, default is 3000.
  • T_CMB: Temperature of the CMB in Kelvin, default is T_CMB constant.

Returns

  • An AbstractVector containing the CIB clustered power spectrum D_ℓ at each in ℓs.

Examples

# Auto-spectrum at 353 GHz
D_ℓ_auto = cib_clustered_power(ℓs, 1.0, 0.8, 1.6, 353.0, 353.0, 1.0, 1.0, 25.0, 150.0)

# Cross-spectrum between 217 and 353 GHz  
D_ℓ_cross = cib_clustered_power(ℓs, 1.0, 0.8, 1.6, 217.0, 353.0, 0.9, 1.1, 25.0, 150.0)
source

Other Foreground Functions

CMBForegrounds.ksz_template_scaledFunction
ksz_template_scaled(template, AkSZ)

Scales a kinematic Sunyaev-Zel'dovich (kSZ) power spectrum template by a given amplitude.

Arguments

  • template: An AbstractVector representing the kSZ power spectrum shape Dℓ.
  • AkSZ: The amplitude scaling factor.

Returns

  • An AbstractVector containing the scaled kSZ power spectrum.
source

Response and Utility Functions

CMBForegrounds.ssl_responseFunction
ssl_response(ℓs, κ, Dℓ)

Calculates the super-sample lensing response in the power spectrum.

The SSL response is:

\[\Delta D_\ell^{\mathrm{SSL}} = -\kappa \left[ \ell \frac{\ell(\ell+1)}{2\pi} \frac{\mathrm{d}C_\ell}{\mathrm{d}\ell} + 2 D_\ell \right]\]

where $\kappa$ is the convergence field and $C_\ell = D_\ell \cdot 2\pi/[\ell(\ell+1)]$.

Arguments

  • ℓs: Multipoles vector
  • κ: Convergence field value
  • Dℓ: Unperturbed power spectrum

Returns

  • Change in power spectrum due to SSL
source
CMBForegrounds.aberration_responseFunction
aberration_response(ℓs, ab_coeff, Dℓ)

Calculates the relativistic aberration response in the power spectrum.

The aberration response is:

\[\Delta D_\ell^{\mathrm{aberr}} = -A_{\mathrm{aberr}} \cdot \ell \frac{\ell(\ell+1)}{2\pi} \frac{\mathrm{d}C_\ell}{\mathrm{d}\ell}\]

where $A_{\mathrm{aberr}}$ is the aberration coefficient related to observer velocity.

Arguments

  • ℓs: Multipoles vector
  • ab_coeff: Aberration coefficient
  • Dℓ: Unperturbed power spectrum

Returns

  • Change in power spectrum due to aberration
source
CMBForegrounds.gaussian_beam_windowFunction
gaussian_beam_window(fwhm_arcmin, ells)

Calculates the Gaussian beam window function.

The beam window function is:

\[B_\ell = \exp\left(-\frac{1}{2} \ell(\ell + 1) \sigma^2\right)\]

where $\sigma = \mathrm{FWHM} / \sqrt{8 \ln 2}$ is the beam standard deviation in radians.

Arguments

  • fwhm_arcmin: Beam FWHM in arcminutes
  • ells: Multipoles vector

Returns

  • Beam window function values
source
CMBForegrounds.fwhm_arcmin_to_sigma_radFunction
fwhm_arcmin_to_sigma_rad(fwhm_arcmin)

Converts a beam's Full-Width at Half-Maximum (FWHM) from arcminutes to its standard deviation (sigma) in radians.

Arguments

  • fwhm_arcmin: The FWHM in units of arcminutes.

Returns

  • The beam sigma in units of radians.
source
CMBForegrounds.shot_noise_powerFunction
shot_noise_power(ℓs, A_ℓ0; ℓ0=3000)

Computes shot noise power spectrum with ℓ² scaling.

The shot noise power spectrum is:

\[D_\ell^{\mathrm{shot}} = A_{\ell_0} \left(\frac{\ell}{\ell_0}\right)^2\]

This represents the white noise contribution from point sources.

Arguments

  • ℓs: Multipoles vector
  • A_ℓ0: Shot noise amplitude at reference multipole

Keywords

  • ℓ0=3000: Reference multipole

Returns

  • Shot noise power spectrum Dℓ
source
CMBForegrounds.dCl_dell_from_DlFunction
dCl_dell_from_Dl(ℓs, Dℓ)

Calculates the derivative of the angular power spectrum.

Converts from $D_\ell$ to $C_\ell$ derivative using:

\[\frac{\mathrm{d}C_\ell}{\mathrm{d}\ell} = \frac{\mathrm{d}}{\mathrm{d}\ell}\left[D_\ell \frac{2\pi}{\ell(\ell+1)}\right]\]

The derivative is computed using central differences for interior points.

Arguments

  • ℓs: Multipoles vector
  • Dℓ: Power spectrum D_\ell values

Returns

  • Derivative dCℓ/dℓ
source
CMBForegrounds.cross_calibration_meanFunction
cross_calibration_mean(cal1, cal2, cal3, cal4)

Calculates the mean of two cross-calibration products. This is a simple utility function, often used for combining calibration factors from different frequency maps.

Arguments

  • cal1, cal2, cal3, cal4: Calibration factors.

Returns

  • The mean value: (cal1 * cal2 + cal3 * cal4) / 2.
source

Constants

Index