aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2015-02-20 18:48:07 +0100
committerThomas White <taw@physics.org>2015-02-20 18:51:53 +0100
commit7b8593424fd230182ca67e320e35159c76066c12 (patch)
treeb305bd26df8fd2db43568b5587ff02ab2dcb2c08 /libcrystfel
parentb95dbc4ee0cb358fdbafd5031a7acce216c37819 (diff)
in_bad_region(): fs/ss bad regions use orig coordinates
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/detector.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/libcrystfel/src/detector.c b/libcrystfel/src/detector.c
index 4d1a15e5..4c7295fe 100644
--- a/libcrystfel/src/detector.c
+++ b/libcrystfel/src/detector.c
@@ -344,10 +344,17 @@ int in_bad_region(struct detector *det, double fs, double ss)
if ( b->is_fsss ) {
- if ( fs < b->min_fs ) continue;
- if ( fs > b->max_fs ) continue;
- if ( ss < b->min_ss ) continue;
- if ( ss > b->max_ss ) continue;
+ int nfs, nss;
+
+ /* fs/ss bad regions are specified according to the
+ * original coordinates */
+ nfs = (fs-p->min_fs) + p->orig_min_fs;
+ nss = (ss-p->min_ss) + p->orig_min_ss;
+
+ if ( nfs < b->min_fs ) continue;
+ if ( nfs > b->max_fs ) continue;
+ if ( nss < b->min_ss ) continue;
+ if ( nss > b->max_ss ) continue;
} else {