mapmaking
Functions that wrap useful minkasi recipes
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
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 |
|
make_maps(todvec, skymap, noise_class, noise_args, noise_kwargs, outdir, npass, dograd, 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 |
return_maps
|
bool
|
If True, return the mapset. Default; False |
False
|
Source code in witch/external/minkasi/mapmaking.py
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 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 |
|
make_naive(todvec, skymap, outdir)
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 |
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. |
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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
|
make_weights(todvec, skymap, outdir)
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 |
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
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 |
|
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
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 |
|
solve_map(todvec, x0, ihits, prior, maxiters, save_iters, outdir, desc_str)
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 |
Returns:
Name | Type | Description |
---|---|---|
mapset |
Mapset
|
The mapset with the solved map. |
Source code in witch/external/minkasi/mapmaking.py
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 240 241 242 243 244 |
|