aboutsummaryrefslogtreecommitdiff
path: root/src/dirax.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dirax.c')
-rw-r--r--src/dirax.c59
1 files changed, 3 insertions, 56 deletions
diff --git a/src/dirax.c b/src/dirax.c
index 2db591f4..991a3813 100644
--- a/src/dirax.c
+++ b/src/dirax.c
@@ -323,63 +323,13 @@ static gboolean dirax_readable(GIOChannel *dirax, GIOCondition condition,
}
-static int map_position(struct image *image, double x, double y,
- double *rx, double *ry, double *rz)
-{
- /* "Input" space */
- double d;
-
- /* Angular description of reflection */
- double theta, psi, k;
-
- x -= image->x_centre;
- y -= image->y_centre;
- k = 1.0 / image->lambda;
-
- /* FIXME: Don't process lower CCD for now */
- if ( y < 0 ) return 0;
-
- if ( image->fmode == FORMULATION_CLEN ) {
-
- /* Convert pixels to metres */
- x /= image->resolution;
- y /= image->resolution; /* Convert pixels to metres */
- d = sqrt((x*x) + (y*y));
- theta = atan2(d, image->camera_len);
-
- } else if (image->fmode == FORMULATION_PIXELSIZE ) {
-
- /* Convert pixels to metres^-1 */
- x *= image->pixel_size;
- y *= image->pixel_size; /* Convert pixels to metres^-1 */
- d = sqrt((x*x) + (y*y));
- theta = atan2(d, k);
-
- } else {
- ERROR("Unrecognised formulation mode in mapping_scale.\n");
- return -1;
- }
-
- psi = atan2(y, x);
-
- *rx = k*sin(theta)*cos(psi);
- *ry = k*sin(theta)*sin(psi);
- *rz = k - k*cos(theta);
-
- return 0;
-}
-
-
-void index_pattern(struct image *image, int no_index, int dump_peaks)
+void run_dirax(struct image *image, int no_index)
{
unsigned int opts;
int saved_stderr;
FILE *fh;
int i;
- /* Do peak search and splurge out 'xfel.drx' */
- search_peaks(image, dump_peaks);
-
fh = fopen("xfel.drx", "w");
if ( !fh ) {
ERROR("Couldn't open temporary file xfel.drx\n");
@@ -390,14 +340,11 @@ void index_pattern(struct image *image, int no_index, int dump_peaks)
for ( i=0; i<image_feature_count(image->features); i++ ) {
struct imagefeature *f;
- double rx = 0.0;
- double ry = 0.0;
- double rz = 0.0;
f = image_get_feature(image->features, i);
- map_position(image, f->x, f->y, &rx, &ry, &rz);
+
fprintf(fh, "%10f %10f %10f %8f\n",
- rx/1e10, ry/1e10, rz/1e10, 1.0);
+ f->rx/1e10, f->ry/1e10, f->rz/1e10, 1.0);
}
fclose(fh);