Fields, Operators and Data Sets¶
All three kinds of object are JAX pytrees, so they can be passed through jax.jit, jax.grad and jax.vmap.
Fields¶
cmb_lensing.fields.FlatS0 ¶
Bases: Field
A spin-0 field on a flat nside x nside patch: temperature, or the lensing potential phi.
Supports +, -, * and / with another FlatS0 or a scalar, element by element.
Attributes:
| Name | Type | Description |
|---|---|---|
scalar_matrix |
ndarray
|
The field, an (nside, nside//2+1) rfft2 array in Fourier space or an (nside, nside) real array in map space. |
basis |
int
|
|
nside |
int
|
Number of pixels on a side. |
theta_pix |
float
|
Pixel width in arcmin. |
pix_width |
float
|
Pixel width in radians. |
fourier_weights |
ndarray
|
Weight of each rfft2 mode in inner products (2 in the bulk, 1 on the self-conjugate columns). |
Source code in cmb_lensing/fields.py
cmb_lensing.fields.FlatS2 ¶
Bases: Field
A spin-2 (polarization) field on a flat patch, stored as E/B or Q/U.
Supports the same element-wise arithmetic as FlatS0. Convert between the
parametrizations with qu2eb() / eb2qu().
Attributes:
| Name | Type | Description |
|---|---|---|
polar_matrix_1 |
ndarray
|
E (or Q) component. |
polar_matrix_2 |
ndarray
|
B (or U) component. |
parametrization |
int
|
|
basis |
int
|
|
nside |
int
|
Number of pixels on a side. |
theta_pix |
float
|
Pixel width in arcmin. |
pix_width |
float
|
Pixel width in radians. |
fourier_weights |
ndarray
|
Weight of each rfft2 mode in inner products. |
Source code in cmb_lensing/fields.py
cmb_lensing.fields.FlatS02 ¶
Bases: Field
A temperature + polarization field on a flat patch: T together with E/B (or Q/U).
Supports the same element-wise arithmetic as FlatS0.
Attributes:
| Name | Type | Description |
|---|---|---|
scalar_matrix |
ndarray
|
T component. |
polar_matrix_1 |
ndarray
|
E (or Q) component. |
polar_matrix_2 |
ndarray
|
B (or U) component. |
parametrization |
int
|
|
basis |
int
|
|
nside |
int
|
Number of pixels on a side. |
theta_pix |
float
|
Pixel width in arcmin. |
pix_width |
float
|
Pixel width in radians. |
fourier_weights |
ndarray
|
Weight of each rfft2 mode in inner products. |
Source code in cmb_lensing/fields.py
Operators¶
cmb_lensing.matrix_operators.DiagonalScalar ¶
Bases: FieldOperator
An operator diagonal in Fourier space acting on FlatS0 fields (e.g. C_TT, C_phi).
operator * field multiplies mode by mode. Operators also combine with each other and
with scalars through +, - and *; pinv and log_det are defined for them.
Attributes:
| Name | Type | Description |
|---|---|---|
scalar_matrix |
ndarray
|
The diagonal, an (nside, nside//2+1) array on the rfft2 grid. |
nside |
int
|
Number of pixels on a side. |
theta_pix |
float
|
Pixel width in arcmin. |
pix_width |
float
|
Pixel width in radians. |
fourier_weights |
ndarray
|
Weight of each rfft2 mode. |
Source code in cmb_lensing/matrix_operators.py
cmb_lensing.matrix_operators.DiagonalEB ¶
Bases: FieldOperator
An operator acting on FlatS2 fields, diagonal in Fourier space with separate E and B
blocks (no EB coupling).
Attributes:
| Name | Type | Description |
|---|---|---|
matrix_EE |
ndarray
|
E block, an (nside, nside//2+1) array on the rfft2 grid. |
matrix_BB |
ndarray
|
B block. |
nside |
int
|
Number of pixels on a side. |
theta_pix |
float
|
Pixel width in arcmin. |
pix_width |
float
|
Pixel width in radians. |
fourier_weights |
ndarray
|
Weight of each rfft2 mode. |
Source code in cmb_lensing/matrix_operators.py
cmb_lensing.matrix_operators.BlockTEB ¶
Bases: FieldOperator
An operator acting on FlatS02 fields: per Fourier mode a 2 x 2 T/E block plus an
independent B block.
Products with another BlockTEB are matrix products of the T/E blocks, so they do not
commute. pinv and log_det use Schur complements.
Attributes:
| Name | Type | Description |
|---|---|---|
matrix_TT |
ndarray
|
TT block, an (nside, nside//2+1) array on the rfft2 grid. |
matrix_TE |
ndarray
|
TE block. |
matrix_ET |
ndarray
|
ET block. |
matrix_EE |
ndarray
|
EE block. |
matrix_BB |
ndarray
|
BB block. |
nside |
int
|
Number of pixels on a side. |
theta_pix |
float
|
Pixel width in arcmin. |
pix_width |
float
|
Pixel width in radians. |
fourier_weights |
ndarray
|
Weight of each rfft2 mode. |
Source code in cmb_lensing/matrix_operators.py
Data sets¶
cmb_lensing.dataset.DataSetT ¶
Bases: DataSet
Temperature-only data set, returned by load_sim(..., pol = "I").
Fields (FlatS0, Fourier space): data, unlensed_field, lensed_field, phi.
Operators (DiagonalScalar): field_covariance (unlensed, scalar + tensor),
lensed_field_covariance, scalar_field_covariance, tensor_field_covariance,
phi_covariance, unscaled_phi_covariance (before a_phi), noise_covariance, mask,
beam, quadratic_estimate (the QE noise, used as N_phi), and the mixing matrices
mixing_d / mixing_g.
Source code in cmb_lensing/dataset.py
cmb_lensing.dataset.DataSetEB ¶
Bases: DataSet
Polarization-only data set, returned by load_sim(..., pol = "P").
Same attributes as DataSetT, but the fields other than phi are FlatS2 (E/B) and the
field operators are DiagonalEB. phi, phi_covariance, quadratic_estimate and
mixing_g stay scalar.
Source code in cmb_lensing/dataset.py
cmb_lensing.dataset.DataSetTEB ¶
Bases: DataSet
Temperature + polarization data set, returned by load_sim(..., pol = "IP").
Same attributes as DataSetT, but the fields other than phi are FlatS02 (T, E, B)
and the field operators are BlockTEB, carrying the TE correlation. phi,
phi_covariance, quadratic_estimate and mixing_g stay scalar.