mapmaking
Functions that wrap useful minkasi recipes
get_grad_prior(todvec, mapset, gradmap, *args, **kwargs)
Make a gradient based prior. This helps avoid errors due to sharp features.
Arguments:
todvec: The TODs what we are mapmaking.
mapset: The mapset to compute priors with.
We assume that the first element is the map we care about.
gradmap: Containter to use as the gradient map.
*args: Additional arguments to pass to get_grad_mask_2d.
**kwargs: Kewword arguments to pass to get_grad_mask_2d.
Returns:
prior: A prior to pass to run_pcg_wprior.
new_mapset: A mapset with the original map and a cleared prior map.
Source code in witch/mapmaking.py
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 |
|
make_naive(todvec, skymap, outdir)
Make a naive map where we just bin common mode subtracted TODs.
Arguments:
todvec: The TODs to mapmake.
skymap: Map to use as footprint for outputs.
Returns:
naive: The navie map.
hits: The hit count map.
We use this as a preconditioner which helps small-scale convergence quite a bit.
Source code in witch/mapmaking.py
12 13 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 |
|
make_weights(todvec, skymap, outdir)
Make weights and noise map.
Arguments:
todvec: The TODs to mapmake.
skymap: Map to use as footprint for outputs.
Returns:
weightmap: The weights map.
noisemap: The noise map.
This is just 1/sqrt(weights).
Source code in witch/mapmaking.py
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 |
|
reestimate_noise_from_map(todvec, mapset, noise_class, noise_args, noise_kwargs)
Use the current guess at the map to reestimate the noise:
Arguments:
todvec: The TODs to reestimate noise for.
mapset: Mapset containing the current map solution.
noise_class: Which noise model to use.
noise_args: Additional arguments to pass to set_noise.
noise_kwargs: Additional keyword argmuents to pass to set_noise.
Source code in witch/mapmaking.py
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 |
|
solve_map(todvec, x0, ihits, prior, maxiters, save_iters, outdir, desc_str)
Solve for map with PCG.
Arguments:
todvec: The TODs what we are mapmaking.
x0: The initial guess mapset.
ihits: The inverse hits map.
prior: Prior to use when mapmaking, set to None to not use.
maxiters: Maximum PCG iters to use.
save_iters: Which iterations to save the map at.
outdir: The output directory
desc_str: String used to deterime outroot.
Returns:
mapset: The mapset with the solved map.
Source code in witch/mapmaking.py
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 |
|