aboutsummaryrefslogtreecommitdiff
path: root/src/mosflm.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-02-28 17:11:00 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:16 +0100
commitc080e2c362628da1a68ad17c117f303945724006 (patch)
treeb24e0c013e34dc2d339d91371ce0c3655a037831 /src/mosflm.c
parent0d2fd58266f87fb20aceb017c68b0e455ab4baee (diff)
First round of fallout from new geometry format
Diffstat (limited to 'src/mosflm.c')
-rw-r--r--src/mosflm.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/mosflm.c b/src/mosflm.c
index bfaca2fb..562b58d7 100644
--- a/src/mosflm.c
+++ b/src/mosflm.c
@@ -199,19 +199,25 @@ static void write_spt(struct image *image, const char *filename)
for ( i=0; i<nPeaks; i++ ) {
struct imagefeature *f;
+ struct panel *p;
+ double xs, ys, rx, ry;
f = image_get_feature(image->features, i);
if ( f == NULL ) continue;
- struct panel *pan;
- pan = find_panel(image->det, f->x, f->y);
- if ( pan == NULL ) continue;
+ p = find_panel(image->det, f->x, f->y);
+ if ( p == NULL ) continue;
- pix = 1000/pan->res; /* pixel size in mm */
+ pix = 1000.0/p->res; /* pixel size in mm */
height = f->intensity;
- sptlines[i].x = (f->y - pan->cy)*pix*fclen/pan->clen/1000;
- sptlines[i].y = -(f->x - pan->cx)*pix*fclen/pan->clen/1000;
+ xs = (f->x-p->min_fs)*p->fsx + (f->y-p->min_ss)*p->ssx;
+ ys = (f->x-p->min_fs)*p->fsy + (f->y-p->min_ss)*p->ssy;
+ rx = xs + p->cnx;
+ ry = ys + p->cny;
+
+ sptlines[i].x = ry*pix*fclen/p->clen/1000.0;
+ sptlines[i].y = -rx*pix*fclen/p->clen/1000.0;
sptlines[i].h = height;
sptlines[i].s = sigma;