Repository navigation
Commit 9a2d5ef
committed
defect: pass the pipeline distortion coefficients to the forward model
build_forward_model negated the amplitudes of the converted distortion
coefficients before handing them to midas_diffract's HEDMForwardModel.
That was a first-order inverse written for a forward model that applied
the pipeline's correction (raw -> ideal) in the wrong direction. The
midas_diffract commit "FF tilt convention and forward distortion
direction" makes the model invert the correction itself, with a fixed
point, so the compensation now double-inverts: with a tilted and
distorted geometry (p0 = 1e-4) the forward model and the reference
predictor raster.predict_reflections disagreed by 0.078 px, against the
1e-2 px the test requires. CI caught it on the first run after that
change: test_forward_model_matches_reference_predictor for the
"tilted+distortion" and "tilted+distortion+wedge" cases.
The coefficients are now passed as md.v1_to_v2_coeffs returns them. This
also removes the O(delta^2) residual the negation left (about 2e-3 px
for realistic coefficients). The two predictors are independent
implementations (the reference path uses midas_transforms
apply_tilt_distortion), so their agreement without the negation is a
second check that the midas_diffract direction is right.
Needs midas-diffract >= 0.10.0: the floor is raised from 0.9.0 and
midas-defect goes from 0.9.0 to 0.9.1. With an older midas_diffract the
distortion would now be applied in the wrong direction.
Behaviour change: spot positions predicted by build_forward_model for a
geometry with distortion move by up to the size of the distortion
(about 0.08 px for the test geometry), toward the reference predictor.
Index-from-cloud results that used distortion on a calibrated geometry
should be re-checked.
Tests: tests/test_indexing_forward_conventions.py passes for all four
cases (flat, tilted, tilted+distortion, tilted+distortion+wedge).1 parent 928d07b commit 9a2d5ef
3 files changed
Lines changed: 9 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
126 | | - | |
127 | | - | |
128 | | - | |
| 127 | + | |
129 | 128 | | |
130 | 129 | | |
131 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
0 commit comments