diff options
author | Thomas White <taw@physics.org> | 2020-12-07 16:11:45 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2020-12-07 16:11:45 +0100 |
commit | e7cf3911104fb525159b937660a3c3b9f6d31ba7 (patch) | |
tree | 95a7c1387d4f62750c54f98765169e73bbc788c8 /libcrystfel/src/indexers/mosflm.c | |
parent | 72f857fbd0c29ba4954f5602ecc43574e581776a (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/indexers/mosflm.c')
-rw-r--r-- | libcrystfel/src/indexers/mosflm.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libcrystfel/src/indexers/mosflm.c b/libcrystfel/src/indexers/mosflm.c index bacd345f..4c1d2906 100644 --- a/libcrystfel/src/indexers/mosflm.c +++ b/libcrystfel/src/indexers/mosflm.c @@ -357,16 +357,21 @@ static void write_spt(struct image *image, const char *filename) struct imagefeature *f; double ttx, tty, x, y; + double r[3]; 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); + ttx = angle_between_2d(0.0, 1.0, - f->rx, 1.0/image->lambda + f->rz); + r[0], 1.0/image->lambda + r[2]); tty = angle_between_2d(0.0, 1.0, - f->ry, 1.0/image->lambda + f->rz); - if ( f->rx < 0.0 ) ttx *= -1.0; - if ( f->ry < 0.0 ) tty *= -1.0; + r[1], 1.0/image->lambda + r[2]); + if ( r[0] < 0.0 ) ttx *= -1.0; + if ( r[1] < 0.0 ) tty *= -1.0; x = -tan(ttx)*FAKE_CLEN; y = tan(tty)*FAKE_CLEN; |