diff options
author | taw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1> | 2007-12-20 22:31:29 +0000 |
---|---|---|
committer | taw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1> | 2007-12-20 22:31:29 +0000 |
commit | a956795a03969c5aec307474400be402388c1430 (patch) | |
tree | 89d2616d804274bf9cb3fa5e5d0981910e1def4e | |
parent | fa3a0f357371cf1b9da58c2e00334c905a898f96 (diff) |
Don't alter parameters by more than 10%
git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@234 bf6ca9ba-c028-0410-8290-897cf20841d1
-rw-r--r-- | src/refine.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/refine.c b/src/refine.c index 25c4243..99dcebe 100644 --- a/src/refine.c +++ b/src/refine.c @@ -171,17 +171,23 @@ static ImageFeature *refine_fit_image(Basis *cell, ImageRecord *image, Reflectio mapping_rotate(dax, day, 0.0, &dlx, &dly, &dlz, image->omega, image->tilt); printf("a changed by %+7.5f %+7.5f %+7.5f nm^-1 in reciprocal space (%+10.5f %+10.5f %+10.5f %%)\n", dlx/1e9, dly/1e9, dlz/1e9, 100*dlx/cell->a.x, 100*dly/cell->a.y, 100*dlz/cell->a.z); - cell->a.x += dlx; cell->a.y += dly; cell->a.z += dlz; + if ( dlx/cell->a.x < 0.1 ) cell->a.x += dlx; + if ( dly/cell->a.y < 0.1 ) cell->a.y += dly; + if ( dlz/cell->a.z < 0.1 ) cell->a.z += dlz; mapping_rotate(dbx, dby, 0.0, &dlx, &dly, &dlz, image->omega, image->tilt); printf("b changed by %+7.5f %+7.5f %+7.5f nm^-1 in reciprocal space (%+10.5f %+10.5f %+10.5f %%)\n", dlx/1e9, dly/1e9, dlz/1e9, 100*dlx/cell->b.x, 100*dly/cell->b.y, 100*dlz/cell->b.z); - cell->b.x += dlx; cell->b.y += dly; cell->b.z += dlz; + if ( dlx/cell->b.x < 0.1 ) cell->b.x += dlx; + if ( dly/cell->b.y < 0.1 ) cell->b.y += dly; + if ( dlz/cell->b.z < 0.1 ) cell->b.z += dlz; mapping_rotate(dcx, dcy, 0.0, &dlx, &dly, &dlz, image->omega, image->tilt); printf("c changed by %+7.5f %+7.5f %+7.5f nm^-1 in reciprocal space (%+10.5f %+10.5f %+10.5f %%)\n", dlx/1e9, dly/1e9, dlz/1e9, 100*dlx/cell->c.x, 100*dly/cell->c.y, 100*dlz/cell->c.z); - cell->c.x += dlx; cell->c.y += dly; cell->c.z += dlz; + if ( dlx/cell->c.x < 0.1 ) cell->c.x += dlx; + if ( dly/cell->c.y < 0.1 ) cell->c.y += dly; + if ( dlz/cell->c.z < 0.1 ) cell->c.z += dlz; return NULL; |