diff options
author | Thomas White <taw@physics.org> | 2011-02-28 17:11:00 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:16 +0100 |
commit | c080e2c362628da1a68ad17c117f303945724006 (patch) | |
tree | b24e0c013e34dc2d339d91371ce0c3655a037831 /src/peaks.c | |
parent | 0d2fd58266f87fb20aceb017c68b0e455ab4baee (diff) |
First round of fallout from new geometry format
Diffstat (limited to 'src/peaks.c')
-rw-r--r-- | src/peaks.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/peaks.c b/src/peaks.c index 676a4387..640188e7 100644 --- a/src/peaks.c +++ b/src/peaks.c @@ -857,6 +857,7 @@ void output_pixels(struct image *image, UnitCell *cell, double pix_area, Lsq, proj_area, dsq, sa; double phi, pa, pb, pol; float tt = 0.0; + double xs, ys, rx, ry; /* Veto if we want to integrate a bad region */ if ( image->flags != NULL ) { @@ -881,8 +882,11 @@ void output_pixels(struct image *image, UnitCell *cell, proj_area = pix_area * cos(tt); /* Calculate distance from crystal to pixel */ - dsq = pow(((double)x - p->cx) / p->res, 2.0); - dsq += pow(((double)y - p->cy) / p->res, 2.0); + xs = (x-p->min_fs)*p->fsx + (y-p->min_ss)*p->ssx; + ys = (x-p->min_fs)*p->fsy + (y-p->min_ss)*p->ssy; + rx = (xs + p->cnx) / p->res; + ry = (ys + p->cny) / p->res; + dsq = sqrt(pow(rx, 2.0) + pow(ry, 2.0)); /* Projected area of pixel / distance squared */ sa = 1.0e7 * proj_area / (dsq + Lsq); |