aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/predict-refine.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-12-07 16:11:45 +0100
committerThomas White <taw@physics.org>2020-12-07 16:11:45 +0100
commite7cf3911104fb525159b937660a3c3b9f6d31ba7 (patch)
tree95a7c1387d4f62750c54f98765169e73bbc788c8 /libcrystfel/src/predict-refine.c
parent72f857fbd0c29ba4954f5602ecc43574e581776a (diff)
Get rid of ImageFeature->rx,ry,rz
These needed to be kept up to date with a call to map_all_peaks every time anything changed - wavelength, detector position etc. Not doing so has already led to bugs in another branch, and probably already causes problems on this branch. This patch eliminates the rx,ry,rz completely. Anyone who needs reciprocal space coordinates for a peak is now responsible for calling detgeom_transform_coords themselves.
Diffstat (limited to 'libcrystfel/src/predict-refine.c')
-rw-r--r--libcrystfel/src/predict-refine.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libcrystfel/src/predict-refine.c b/libcrystfel/src/predict-refine.c
index 43a52cae..1c9e8504 100644
--- a/libcrystfel/src/predict-refine.c
+++ b/libcrystfel/src/predict-refine.c
@@ -191,16 +191,21 @@ static int pair_peaks(struct image *image, Crystal *cr,
struct imagefeature *f;
double h, k, l, hd, kd, ld;
Reflection *refl;
+ double r[3];
/* Assume all image "features" are genuine peaks */
f = image_get_feature(image->features, i);
if ( f == NULL ) continue;
+ detgeom_transform_coords(&image->detgeom->panels[f->pn],
+ f->fs, f->ss, image->lambda,
+ r);
+
/* Decimal and fractional Miller indices of nearest reciprocal
* lattice point */
- hd = f->rx * ax + f->ry * ay + f->rz * az;
- kd = f->rx * bx + f->ry * by + f->rz * bz;
- ld = f->rx * cx + f->ry * cy + f->rz * cz;
+ hd = r[0] * ax + r[1] * ay + r[2] * az;
+ kd = r[0] * bx + r[1] * by + r[2] * bz;
+ ld = r[0] * cx + r[1] * cy + r[2] * cz;
h = lrint(hd);
k = lrint(kd);
l = lrint(ld);