mapmaking
Functions that wrap useful minkasi recipes
apply_mask(input_mapset, maskset)
Apply a mask to a set of input maps.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_mapset
|
Mapset
|
Maps to apply the mask to. |
required |
maskset
|
Mapset
|
Masks to apply; defined per map |
required |
Returns:
| Name | Type | Description |
|---|---|---|
target_mapset |
Mapset
|
Masked version of input mapset. |
Source code in witch/external/minkasi/mapmaking.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | |
get_grad_prior(todvec, mapset, gradmap, *args, **kwargs)
Make a gradient based prior from a map. This helps avoid errors due to sharp features.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
todvec
|
TodVec
|
The TODs what we are mapmaking. |
required |
mapset
|
Mapset
|
The mapset to compute priors with. We assume that the first element is the map we care about. |
required |
gradmap
|
MapType
|
Containter to use as the gradient map. |
required |
*args
|
Unpack[tuple]
|
Additional arguments to pass to get_grad_mask_2d. |
()
|
**kwargs
|
Keyword arguments to pass to get_grad_mask_2d. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
new_mapset |
Mapset
|
A mapset with the original map and a cleared prior map. |
Source code in witch/external/minkasi/mapmaking.py
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 | |
make_maps(todvec, skymap, noise_class, noise_args, noise_kwargs, outdir, npass, dograd, thresh=None, return_maps=False)
Make a minkasi map with multple passes and noise reestimation. Unless you are an expert this will usually be all you need.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
todvec
|
TodVec
|
The tods to mapmake. |
required |
skymap
|
MapType
|
Map to use as a template. The contents don't matter only the shape and WCS info. |
required |
noise_class
|
NoiseModelType
|
The noise model to use on the TODs. |
required |
noise_args
|
tuple
|
Arguments to pass to |
required |
noise_kwargs
|
dict
|
Keyword arguments to pass to |
required |
outdir
|
str
|
The output directory. |
required |
npass
|
int
|
The number of times to mapmake and then reestimate the noise. |
required |
dograd
|
bool
|
If True make a map based prior to avoid biases from sharp features. |
required |
thresh
|
int
|
If set, mask pixels with value less than thresh durring map-making. Default; None |
None
|
return_maps
|
bool
|
If True, return the mapset. Default; False |
False
|
Source code in witch/external/minkasi/mapmaking.py
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 | |
make_naive(todvec, skymap, outdir, thresh=None)
Make a naive map where we just bin common mode subtracted TODs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
todvec
|
TodVec
|
The TODs to mapmake. |
required |
skymap
|
MapType
|
Map to use as footprint for outputs. |
required |
thresh
|
int
|
If set, mask pixels with value less than thresh durring map-making. Default; None |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
naive |
MapType
|
The naive map. |
hits |
MapType
|
The hit count map. We use this as a preconditioner which helps small-scale convergence quite a bit. |
maskset |
Mapset
|
Set of masks for the maps. |
Source code in witch/external/minkasi/mapmaking.py
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 | |
make_weights(todvec, skymap, outdir, maskset=None)
Make weights and noise map.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
todvec
|
TodVec
|
The TODs to mapmake. |
required |
skymap
|
MapType
|
Map to use as footprint for outputs. |
required |
maskset
|
Mapset
|
Set of masks for the maps. Default; None |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
weightmap |
MapType
|
The weights map. |
noisemap |
MapType
|
The noise map. This is just 1/sqrt(weights). |
Source code in witch/external/minkasi/mapmaking.py
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 | |
reestimate_noise_from_map(todvec, mapset, noise_class, noise_args, noise_kwargs)
Use the current guess at the map to reestimate the noise:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
todvec
|
TodVec
|
The TODs to reestimate noise for. |
required |
mapset
|
Mapset
|
Mapset containing the current map solution. |
required |
noise_class
|
NoiseModelType
|
Which noise model to use. |
required |
noise_args
|
tuple
|
Additional arguments to pass to |
required |
noise_kwargs
|
dict
|
Additional keyword arguments to pass to |
required |
Source code in witch/external/minkasi/mapmaking.py
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 | |
solve_map(todvec, x0, ihits, prior, maxiters, save_iters, outdir, desc_str, maskset=None)
Solve for map with PCG.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
todvec
|
TodVec
|
The TODs what we are mapmaking. |
required |
x0
|
Mapset
|
The initial guess mapset. |
required |
ihits
|
MapType
|
The inverse hits map. |
required |
prior
|
Optional[HasPrior]
|
Prior to use when mapmaking, set to None to not use. |
required |
maxiters
|
int
|
Maximum PCG iters to use. |
required |
save_iters
|
list[int]
|
Which iterations to save the map at. |
required |
outdir
|
str
|
The output directory |
required |
desc_str
|
str
|
String used to determine outroot. |
required |
maskset
|
Mapset
|
Set of masks for the maps. Default; None |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
mapset |
Mapset
|
The mapset with the solved map. |
Source code in witch/external/minkasi/mapmaking.py
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | |