Noise – Noise related routines

The noise related routines are in the micmac.noise module. Currently, they only include pixel and harmonic related functions for uncorrelated Gaussian noise.

micmac.noise.noisecovar module

Noise covariance matrix and useful recurring operations.

get_BtinvN(invN, B, jax_use=False)[source]

B can be full Mixing Matrix, or just the cmb part, or just the fgs part.

Parameters:
invN : array[float] of dimensions [nfreq, nfreq, ...]

inverse noise covariance matrix in uK^-2

B : array[float] of dimensions [nfreq, ncomp, ...]

mixing matrix

jax_use : bool

whether to use jax or not for the einsum operation

Returns:

BtinvN – matrix product B^T * invN

Return type:

array[float] of dimensions [ncomp, nfreq, …]

get_BtinvNB(invN, B, jax_use=False)[source]

B can be full Mixing Matrix, or just the cmb part, or just the fgs part.

Parameters:
invN : array[float] of dimensions [nfreq, nfreq, ...]

inverse noise covariance matrix in uK^-2

B : array[float] of dimensions [nfreq, ncomp, ...]

mixing matrix

jax_use : bool

whether to use jax or not for the einsum operation

Returns:

BtinvNB – matrix product B^T * invN * B

Return type:

array[float] of dimensions [ncomp, nfreq, nfreq, …]

get_Cl_noise(depth_p, A, lmax, jax_use=False)[source]

Function used only in harmonic case A: is pixel independent MixingMatrix, thus if you want to get it from full MixingMatrix you have to select the entry correspondind to one pixel

Parameters:
depth_p : array[float] of dimensions [nfreq]

polarization depth in uK.arcmin, one value per freq channel

A : array[float] of dimensions [ncomp, nfreq]

mixing matrix

lmax : int

maximum ell for the spectrum

Returns:

inv_AtNA – inverse of At N^-1 A in harmonic domain

Return type:

array[float] of dimensions [ncomp, ncomp, lmax+1]

get_Cl_noise_JAX(depth_p, A, lmax)[source]

Note: Function for testing purposes

Function used only in harmonic case A: is pixel independent MixingMatrix, thus if you want to get it from full MixingMatrix you have to select the entry correspondind to one pixel

Parameters:
depth_p : array[float] of dimensions [nfreq]

polarization depth in uK.arcmin, one value per freq channel

A : array[float] of dimensions [ncomp, nfreq]

mixing matrix

lmax : int

maximum ell for the spectrum

Returns:

inv_AtNA – inverse of At N^-1 A in harmonic domain

Return type:

array[float] of dimensions [ncomp, ncomp, lmax+1]

get_Wd(invN, B, d, jax_use=False)[source]

Returns W d = inv(Bt invN B) Bt invN d

Parameters:
invN : array[float] of dimensions [nfreq, nfreq, ...]

inverse noise covariance matrix

B : array[float] of dimensions [nfreq, ncomp, ...]

mixing matrix

d : array[float] of dimensions [nfreq, ...]

frequency maps

Returns:

Wd – W d = inv(Bt invN B) Bt invN d

Return type:

array[float] of dimensions [ncomp, …]

get_freq_inv_noise_JAX(depth_p, lmax)[source]
get_inv_BtinvNB(invN, B, jax_use=False)[source]

B can be full Mixing Matrix, or just the cmb part, or just the fgs part.

Parameters:
invN : array[float] of dimensions [nfreq, nfreq, ...]

inverse noise covariance matrix in uK^-2

B : array[float] of dimensions [nfreq, ncomp, ...]

mixing matrix

jax_use : bool

whether to use jax or not for the einsum and inverse operations

Returns:

invBtinvNB – pseudo-inverse of matrix product B^T * invN * B

Return type:

array[float] of dimensions [ncomp, nfreq, nfreq, …]

get_inv_BtinvNB_c_ell(freq_inv_noise, mixing_matrix)[source]

Function used only in harmonic case mixing_matrix: is pixel independent MixingMatrix, thus if you want to get it from full MixingMatrix you have to select the entry correspondind to one pixel

Parameters:
freq_inv_noise : array[float] of dimensions [nfreq, nfreq, lmax+1]

inverse noise covariance matrix in uK^-2

mixing_matrix : array[float] of dimensions [ncomp, nfreq]

mixing matrix

Returns:

BtinvNB – pseudo-inverse of matrix product B^T * invN * B

Return type:

array[float] of dimensions [lmax+1, ncomp, ncomp]

get_noise_covar(depth_p, nside)[source]

Noise covariance matrix (nfreq*nfreq).

Parameters:
depth_p : array[float] of dimensions [nfreq]

polarization depth in uK.arcmin, one value per freq channel

nside : int

nside of the input maps

Returns:

invN – inverse noise covariance matrix in uK^-2

Return type:

array[float] of dimensions [nfreq, nfreq]

get_noise_covar_extended(depth_p, nside)[source]

Noise covariance matrix (nfreq*nfreq) extended to the pixel domain.

Parameters:
depth_p : array[float] of dimensions [nfreq]

polarization depth in uK.arcmin, one value per freq channel

nside : int

nside of the input maps

Returns:

invN – inverse noise covariance matrix in uK^-2 extended to pixel domain

Return type:

array[float] of dimensions [nfreq, nfreq, 12*nside**2]

get_true_Cl_noise(depth_p, lmax)[source]

Function used only in harmonic case Returns the inverse noise power spectrum

Parameters:
depth_p : array[float] of dimensions [nfreq]

polarization depth in uK.arcmin, one value per freq channel

lmax : int

maximum ell for the spectrum

Returns:

Cl_noise – Cl noise

Return type:

array[float] of dimensions [nfreq, nfreq, lmax+1]