aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2015-04-17 11:11:01 +0200
committerThomas White <taw@physics.org>2015-04-20 15:50:41 +0200
commit1f83bf629093e45c2c16d91b9947158127265a86 (patch)
tree4054b031684a0414a47b8bb60e9c396181106703
parent55e593d3402861c127cbd96de9e36c85b45bf96f (diff)
Add a simple rejection criterion to the prediction refinement
-rwxr-xr-xscripts/plot-predict-refine1
-rw-r--r--src/process_image.c7
2 files changed, 8 insertions, 0 deletions
diff --git a/scripts/plot-predict-refine b/scripts/plot-predict-refine
index 68baffdc..5af7b39c 100755
--- a/scripts/plot-predict-refine
+++ b/scripts/plot-predict-refine
@@ -8,4 +8,5 @@ set xlabel "Profile radius before refinement / nm^-1"
set ylabel "Profile radius after refinement / nm^-1"
plot "plotme.dat" using 4:7
replot x
+replot 1.2*x
EOF
diff --git a/src/process_image.c b/src/process_image.c
index c00976e1..c159465f 100644
--- a/src/process_image.c
+++ b/src/process_image.c
@@ -71,6 +71,13 @@ static void try_refine_autoR(struct image *image, Crystal *cr)
refine_radius(cr, image);
new_R = crystal_get_profile_radius(cr);
+ if ( (new_R > 0.02e9) || (new_R > 1.2*old_R) ) {
+ STATUS("Rejecting refinement solution with "
+ "R %.3f -> %.3f nm^-1\n", old_R, new_R);
+ crystal_set_user_flag(cr, 1);
+ return;
+ }
+
snprintf(notes, 1024, "predict_refine/R old = %.5f new = %.5f nm^-1",
old_R/1e9, new_R/1e9);
crystal_add_notes(cr, notes);