aboutsummaryrefslogtreecommitdiff
path: root/src/refine.c
diff options
context:
space:
mode:
authortaw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1>2007-11-11 20:52:29 +0000
committertaw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1>2007-11-11 20:52:29 +0000
commit9665d9b38ec7d6ae515ef88e2bc849018e096bd2 (patch)
treecaf6b10ec71303f526d2395ff2645e63d4edfced /src/refine.c
parent4b6725f92bd05657134476056c88c3e224c10101 (diff)
Restore loop
git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@191 bf6ca9ba-c028-0410-8290-897cf20841d1
Diffstat (limited to 'src/refine.c')
-rw-r--r--src/refine.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/refine.c b/src/refine.c
index 7838e56..8f8761a 100644
--- a/src/refine.c
+++ b/src/refine.c
@@ -116,23 +116,24 @@ static ImageFeature *refine_fit_image(Basis *cell, ImageRecord *image, Reflectio
/* Skip if no partner */
if ( !rflist->features[i].partner ) continue;
+ h = rflist->features[i].h;
+ k = rflist->features[i].k;
+ l = rflist->features[i].l;
+
/* Determine the difference vector */
dix = rflist->features[i].partner->x - rflist->features[i].x;
diy = rflist->features[i].partner->y - rflist->features[i].y;
+ printf("Feature %3i: %3i %3i %3i dev = %f %f px\n", i, h, k, l, dix, diy);
/* Map the difference vector to the relevant tilted plane */
old_x = rflist->features[i].partner->x;
old_y = rflist->features[i].partner->y;
- rflist->features[i].partner->x = dix;
- rflist->features[i].partner->y = diy;
+ rflist->features[i].partner->x = dix + rflist->features[i].partner->parent->x_centre;
+ rflist->features[i].partner->y = diy + rflist->features[i].partner->parent->y_centre;
mapping_map_to_space(rflist->features[i].partner, &dx, &dy, &dz, &twotheta);
rflist->features[i].partner->x = old_x;
rflist->features[i].partner->y = old_y;
-
- h = rflist->features[i].h;
- k = rflist->features[i].k;
- l = rflist->features[i].l;
- printf("Feature %3i: %3i %3i %3i dev=%8e %8e %8e (%5f mrad)\n", i, h, k, l, dx, dy, dz, twotheta*1e3);
+ printf("dev=%8e %8e %8e (%5f mrad)\n", dx, dy, dz, twotheta*1e3);
/* Select the basis vectors which are allowed to be altered */
index = 0;
@@ -199,8 +200,6 @@ static ImageFeature *refine_fit_image(Basis *cell, ImageRecord *image, Reflectio
done = TRUE;
- break;
-
}
if ( !done ) {
@@ -230,7 +229,7 @@ static ImageFeature *refine_fit_image(Basis *cell, ImageRecord *image, Reflectio
ret = rflist->features[i].partner;
image_feature_list_free(rflist);
- return ret;
+ return NULL;
}
@@ -278,8 +277,9 @@ static gint refine_step(GtkWidget *step_button, ControlContext *ctx) {
ImageFeature *fitted;
fitted = refine_fit_image(ctx->cell, &ctx->images->images[ctx->reproject_cur_image], ctx->cell_lattice);
+ reproject_lattice_changed(ctx);
+ displaywindow_update(ctx->dw);
if ( fitted ) {
- reproject_lattice_changed(ctx);
imagedisplay_add_mark(ctx->reproject_id, fitted->x,fitted->y, IMAGEDISPLAY_MARK_CIRCLE_3);
}