forward_modeling
Functions for performing forward modeling
get_chis(m, idx, idy, rhs, v, weight, dd=None)
A faster, but more importantly much less memory intensive, way to get chis.
The idea is
the first term only has to do with the data. If we care about the absolute value of
This term is essentially what we've been doing before, except that m is now in map shape,
whereas before m was in tod shape so we essentially had
Parameters:
Name | Type | Description | Default |
---|---|---|---|
m |
NDArray[floating]
|
The model evaluated at all the map pixels |
required |
idx |
NDArray[floating]
|
tod.info["model_idx"], the x index output by tod_to_index |
required |
idy |
NDArray[floating]
|
tod.info["model_idy"], the y index output by tod_to_index |
required |
rhs |
NDArray[floating]
|
The map output of todvec.make_rhs. Note this is how the data enters into the chi2 calc. |
required |
v |
NDArray[floating]
|
The right singular vectors for the noise SVD. These rotate the data into the basis of the SVD. |
required |
weight |
NDArray[floating]
|
The noise weights, in fourier space, SVD decomposed. |
required |
dd |
None | floating
|
Optional chi2 from dd. Not necessary for MCMC but is important for evaluating goodness of fit. |
None
|
Outputs
chi2 : np.floating The chi2 of the model m to the data.
Source code in witch/forward_modeling.py
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 |
|
sample(model_params, xyz, beam, params, tods)
Generate a model realization and compute the chis of that model to data.
Arguements:
tods: Array of tod parameters. See prep tods
params: model parameters
model_params: number of each model componant
xyz: grid to evaluate model at
beam: Beam to smooth by
Returns:
chi2: the chi2 difference of the model to the tods
Source code in witch/forward_modeling.py
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 |
|