brahmap.core.ProcessTimeSamples¶
Bases: BaseProcessTimeSamples
A standard process-time-samples data container to store pre-processed pointing information, pre-computed map-making weights and metadata.
This class ingests raw pointing arrays, polarization angles, and noise weights, and computes the necessary pixel-space representations (such as hit counts and trigonometric weight sums) required for the iterative map-making process. It automatically drops unobserved or pathological pixels to minimize the memory footprint of the container.
After pre-processing, the container object can be used to create pointing operators, block-diagonal preconditioners, etc. as required for map-making.
This container manages pixel-space hit counts and trigonometric
weight sums on each MPI process. It uses standard MPI collectives (like
MPI_Allreduce) to globally synchronize and check observed pixels and
calculate pixel-space map objects.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
npix
|
int
|
Number of pixels on which the map-making has to be done (e.g.
|
required |
pointings
|
NDArray[integer]
|
A 1-d array of pixel indices pointing to the sky map for each time sample |
required |
pointings_flag
|
NDArray[bool_] | None
|
A 1-d boolean array where |
None
|
solver_type
|
SolverType
|
The level of map-making solver to construct (\(I\), \(QU\), or
\(IQU\)), by default |
IQU
|
pol_angles
|
NDArray[number] | None
|
A 1-d array containing the polarization orientation angles of the
detectors for each sample, by default |
None
|
noise_weights
|
NDArray[number] | None
|
A 1-d array containing the inverse noise variance for each time
sample, by default |
None
|
threshold
|
float
|
The condition number threshold used to flag degenerate or
under-sampled pixels, by default |
1e-05
|
dtype_float
|
DTypeFloat | None
|
The data type to use for floating point arrays, by default
|
None
|
update_pointings_inplace
|
bool
|
If |
False
|
Methods:
| Name | Description |
|---|---|
get_hit_counts |
Returns hit counts of the pixel indices. |
Attributes:
| Name | Type | Description |
|---|---|---|
npix |
int
|
Number of pixels on which the map-making has to be done. |
pointings |
NDArray[integer]
|
A 1-d array of pixel indices pointing to the observed sky pixel |
pointings_flag |
NDArray[bool_] | None
|
A 1-d boolean array where |
nsamples |
int
|
The number of time samples processed by the current MPI rank |
nsamples_global |
int
|
The total number of time samples across all MPI ranks |
solver_type |
SolverType
|
The current map-making solver configuration (\(I\), \(QU\), or \(IQU\)) |
threshold |
float
|
The condition number threshold used to flag bad pixels |
dtype_float |
Any
|
The inferred or specified data type for floating point arrays |
observed_pixels |
NDArray[integer]
|
A 1-d array containing the original indices of the pixels that |
pixel_flag |
NDArray[bool_]
|
A 1-d boolean array of size |
bad_pixels |
NDArray[integer]
|
A 1-d array that contains all the pixel indices that will be excluded |
old2new_pixel |
NDArray[integer]
|
A 1-d array mapping old pixel indices to new pixel indices |
weighted_counts |
NDArray[number]
|
A 1-d array accumulating the inverse noise weights per valid pixel |
sin2phi |
NDArray[number]
|
A 1-d array containing \(\sin(2\phi)\) evaluated at the valid time samples |
cos2phi |
NDArray[number]
|
A 1-d array containing \(\cos(2\phi)\) evaluated at the valid time samples |
weighted_sin |
NDArray[number]
|
A 1-d array accumulating the noise-weighted \(\sin(2\phi)\) sum |
weighted_cos |
NDArray[number]
|
A 1-d array accumulating the noise-weighted \(\cos(2\phi)\) sum |
weighted_sin_sq |
NDArray[number]
|
A 1-d array accumulating the noise-weighted \(\sin^2(2\phi)\) sum |
weighted_cos_sq |
NDArray[number]
|
A 1-d array accumulating the noise-weighted \(\cos^2(2\phi)\) sum |
weighted_sincos |
NDArray[number]
|
A 1-d array accumulating the noise-weighted \(\sin(2\phi)\cos(2\phi)\) |
one_over_determinant |
NDArray[number]
|
A 1-d array containing the inverse determinant of the |
new_npix |
int
|
The number of pixels on which the map-making will be done |
Source code in brahmap/core/process_time_samples.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 | |
Attributes¶
npix: int
property
¶
Number of pixels on which the map-making has to be done.
Returns:
| Type | Description |
|---|---|
int
|
Number of pixels on which the map-making has to be done |
pointings: npt.NDArray[np.integer]
property
¶
A 1-d array of pixel indices pointing to the observed sky pixel for each time sample
Returns:
| Type | Description |
|---|---|
NDArray[integer]
|
A 1-d array of pixel pointing indices for each time sample |
pointings_flag: npt.NDArray[np.bool_] | None
property
¶
A 1-d boolean array where True indicates a valid pointing and
False flags a bad pointing
Returns:
| Type | Description |
|---|---|
NDArray[bool_]
|
The 1-d array of flags indicating valid ( |
(`False`) time samples
|
|
nsamples: int
property
¶
The number of time samples processed by the current MPI rank
Returns:
| Type | Description |
|---|---|
int
|
Number of samples on current MPI rank |
nsamples_global: int
property
¶
The total number of time samples across all MPI ranks
Returns:
| Type | Description |
|---|---|
int
|
Global number of samples |
solver_type: SolverType
property
¶
The current map-making solver configuration (\(I\), \(QU\), or \(IQU\))
Returns:
| Type | Description |
|---|---|
SolverType
|
Level of map-making: \(I\), \(QU\), or \(IQU\) |
threshold: float
property
¶
The condition number threshold used to flag bad pixels
Returns:
| Type | Description |
|---|---|
float
|
Threshold to used for flagging the pixels in the sky |
dtype_float: Any
property
¶
The inferred or specified data type for floating point arrays
Returns:
| Type | Description |
|---|---|
DTypeFloat
|
|
observed_pixels: npt.NDArray[np.integer]
property
¶
A 1-d array containing the original indices of the pixels that are fully valid for map-making
Returns:
| Type | Description |
|---|---|
NDArray[integer]
|
A 1-d array that contains all the pixel indices that are considered valid for map-making |
pixel_flag: npt.NDArray[np.bool_]
property
¶
A 1-d boolean array of size npix where True indicates a bad
pixel and False flags a valid pixel
Returns:
| Type | Description |
|---|---|
NDArray[bool_]
|
A 1-d boolean array of size |
bad_pixels: npt.NDArray[np.integer]
property
¶
A 1-d array that contains all the pixel indices that will be excluded in map-making.
Returns:
| Type | Description |
|---|---|
NDArray[integer]
|
A 1-d array that contains all the pixel indices that will be excluded in map-making |
old2new_pixel: npt.NDArray[np.integer]
property
¶
A 1-d array mapping old pixel indices to new pixel indices
Returns:
| Type | Description |
|---|---|
NDArray[integer]
|
A 1-d array mapping old pixel indices to new pixel indices |
weighted_counts: npt.NDArray[np.number]
property
¶
A 1-d array accumulating the inverse noise weights per valid pixel
Returns:
| Type | Description |
|---|---|
NDArray[number]
|
A 1-d array accumulating the inverse noise weights per valid pixel |
sin2phi: npt.NDArray[np.number]
property
¶
A 1-d array containing \(\sin(2\phi)\) evaluated at the valid time samples
Returns:
| Type | Description |
|---|---|
NDArray[number]
|
A 1-d array containing \(\sin(2\phi)\) evaluated at the valid time samples |
cos2phi: npt.NDArray[np.number]
property
¶
A 1-d array containing \(\cos(2\phi)\) evaluated at the valid time samples
Returns:
| Type | Description |
|---|---|
NDArray[number]
|
A 1-d array containing \(\cos(2\phi)\) evaluated at the valid time samples |
weighted_sin: npt.NDArray[np.number]
property
¶
A 1-d array accumulating the noise-weighted \(\sin(2\phi)\) sum per valid pixel
Returns:
| Type | Description |
|---|---|
NDArray[number]
|
A 1-d array accumulating the noise-weighted \(\sin(2\phi)\) sum per valid pixel |
weighted_cos: npt.NDArray[np.number]
property
¶
A 1-d array accumulating the noise-weighted \(\cos(2\phi)\) sum per valid pixel
Returns:
| Type | Description |
|---|---|
NDArray[number]
|
A 1-d array accumulating the noise-weighted \(\cos(2\phi)\) sum per valid pixel |
weighted_sin_sq: npt.NDArray[np.number]
property
¶
A 1-d array accumulating the noise-weighted \(\sin^2(2\phi)\) sum per valid pixel
Returns:
| Type | Description |
|---|---|
NDArray[number]
|
A 1-d array accumulating the noise-weighted \(\sin^2(2\phi)\) sum per valid pixel |
weighted_cos_sq: npt.NDArray[np.number]
property
¶
A 1-d array accumulating the noise-weighted \(\cos^2(2\phi)\) sum per valid pixel
Returns:
| Type | Description |
|---|---|
NDArray[number]
|
A 1-d array accumulating the noise-weighted \(\cos^2(2\phi)\) sum per valid pixel |
weighted_sincos: npt.NDArray[np.number]
property
¶
A 1-d array accumulating the noise-weighted \(\sin(2\phi)\cos(2\phi)\) sum per valid pixel
Returns:
| Type | Description |
|---|---|
NDArray[number]
|
A 1-d array accumulating the noise-weighted \(\sin(2\phi)\cos(2\phi)\) sum per valid pixel |
one_over_determinant: npt.NDArray[np.number]
property
¶
A 1-d array containing the inverse determinant of the block-diagonal operator \(P^T diag(N)^{-1} P\)
Returns:
| Type | Description |
|---|---|
NDArray[number]
|
A 1-d array containing the inverse determinant of the block-diagonal operator \(P^T diag(N)^{-1} P\) |
new_npix: int
property
¶
The number of pixels on which the map-making will be done
Returns:
| Type | Description |
|---|---|
int
|
Number of pixels on which the map-making will be done |
Methods:¶
get_hit_counts() -> np.ma.MaskedArray
¶
Returns hit counts of the pixel indices.
Returns:
| Type | Description |
|---|---|
NDArray[integer]
|
Hit counts of the pixel indices |