diff options
author | Thomas White <taw27@cam.ac.uk> | 2008-10-15 17:31:20 +0100 |
---|---|---|
committer | Thomas White <taw27@cam.ac.uk> | 2008-10-15 17:31:20 +0100 |
commit | a9adb2a2d6cfb427637afc18e59fbd282400c582 (patch) | |
tree | 4bacbc529ce535b6904c233a2b405fa9da46af0d | |
parent | 0875545e5d030661fc5e409a190b32b39c9e46c2 (diff) |
Us mapping_rotate to get 'n' (and hence 'k')
-rw-r--r-- | src/reproject.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/reproject.c b/src/reproject.c index e008944..f7e7816 100644 --- a/src/reproject.c +++ b/src/reproject.c @@ -52,7 +52,7 @@ ImageFeatureList *reproject_get_reflections(ImageRecord *image, ReflectionList * Reflection *reflection; double smax = 0.1e9; double tilt, omega; - double nx, ny, nz, nxt, nyt, nzt; /* "normal" vector (and calculation intermediates) */ + double nx, ny, nz; /* "normal" vector */ double kx, ky, kz; /* Electron wavevector ("normal" times 1/lambda */ double ux, uy, uz; /* "up" vector */ int done_debug = 0; @@ -63,19 +63,14 @@ ImageFeatureList *reproject_get_reflections(ImageRecord *image, ReflectionList * tilt = image->tilt; omega = image->omega; - /* Calculate the (normalised) incident electron wavevector - * n is rotated "into" the reconstruction, so only one omega step. */ - nxt = 0.0; nyt = 0.0; nzt = 1.0; - nx = nxt; ny = cos(tilt)*nyt + sin(tilt)*nzt; nz = -sin(tilt)*nyt + cos(tilt)*nzt; - nxt = nx; nyt = ny; nzt = nz; - nx = nxt*cos(-omega) + nyt*sin(-omega); ny = -nxt*sin(-omega) + nyt*cos(-omega); nz = nzt; + /* Calculate the (normalised) incident electron wavevector */ + mapping_rotate(0.0, 0.0, 1.0, &nx, &ny, &nz, omega, tilt); kx = nx / image->lambda; ky = ny / image->lambda; kz = nz / image->lambda; /* This is the centre of the Ewald sphere */ reflection_add(ctx->reflectionlist, kx, ky, kz, 1, REFLECTION_VECTOR_MARKER_1); - /* Determine where "up" is - * See above. */ + /* Determine where "up" is */ mapping_rotate(0.0, 1.0, 0.0, &ux, &uy, &uz, omega, tilt); reflection_add(ctx->reflectionlist, ux*50e9, uy*50e9, uz*50e9, 1, REFLECTION_VECTOR_MARKER_2); |