aboutsummaryrefslogtreecommitdiff
path: root/src/diffraction.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-09-29 17:37:49 +0200
committerThomas White <taw@physics.org>2012-02-22 15:27:00 +0100
commit0da8b0efa29a1d581a15ffacafec5e1e5dec76ea (patch)
treeee465c0fe0710520882a16fe6328c12a12e22380 /src/diffraction.c
parentfb8fc1fab3792488e5f3ab0e2ef9ed89189c47d9 (diff)
Move get_q() and get_tt() to detector.c
Diffstat (limited to 'src/diffraction.c')
-rw-r--r--src/diffraction.c53
1 files changed, 0 insertions, 53 deletions
diff --git a/src/diffraction.c b/src/diffraction.c
index efc56231..5ffe94a8 100644
--- a/src/diffraction.c
+++ b/src/diffraction.c
@@ -294,59 +294,6 @@ double water_diffraction(struct rvec q, double en,
}
-struct rvec get_q(struct image *image, unsigned int xs, unsigned int ys,
- unsigned int sampling, float *ttp, float k)
-{
- struct rvec q;
- float twotheta, r, az;
- float rx;
- float ry;
- struct panel *p;
-
- const unsigned int x = xs / sampling;
- const unsigned int y = ys / sampling; /* Integer part only */
-
- p = find_panel(image->det, x, y);
- assert(p != NULL);
-
- rx = ((float)xs - (sampling*p->cx)) / (sampling * p->res);
- ry = ((float)ys - (sampling*p->cy)) / (sampling * p->res);
-
- /* Calculate q-vector for this sub-pixel */
- r = sqrt(pow(rx, 2.0) + pow(ry, 2.0));
-
- twotheta = atan2(r, p->clen);
- az = atan2(ry, rx);
- if ( ttp != NULL ) *ttp = twotheta;
-
- q.u = k * sin(twotheta)*cos(az);
- q.v = k * sin(twotheta)*sin(az);
- q.w = k - k * cos(twotheta);
-
- return quat_rot(q, image->orientation);
-}
-
-
-double get_tt(struct image *image, unsigned int xs, unsigned int ys)
-{
- float r, rx, ry;
- struct panel *p;
-
- const unsigned int x = xs;
- const unsigned int y = ys; /* Integer part only */
-
- p = find_panel(image->det, x, y);
-
- rx = ((float)xs - p->cx) / p->res;
- ry = ((float)ys - p->cy) / p->res;
-
- /* Calculate q-vector for this sub-pixel */
- r = sqrt(pow(rx, 2.0) + pow(ry, 2.0));
-
- return atan2(r, p->clen);
-}
-
-
void get_diffraction(struct image *image, int na, int nb, int nc,
const double *intensities, const double *phases,
UnitCell *cell, int do_water, GradientMethod m)