aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/detector.c
diff options
context:
space:
mode:
authorValerio Mariani <valerio.mariani@desy.de>2014-11-19 16:39:48 +0100
committerThomas White <taw@physics.org>2014-11-21 16:48:47 +0100
commit225f2f78c0f0606ec3b1d305ff084df950b0c6f5 (patch)
treeeac20defd3bc5b09cfe0413e793ebaf06a8e0037 /libcrystfel/src/detector.c
parent698402c50ee46bae40d0761c8fe1f3f6176e3041 (diff)
Moved fs ss rerrangement to get_detector_geometry
Diffstat (limited to 'libcrystfel/src/detector.c')
-rw-r--r--libcrystfel/src/detector.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/libcrystfel/src/detector.c b/libcrystfel/src/detector.c
index 513d08f1..09eb964d 100644
--- a/libcrystfel/src/detector.c
+++ b/libcrystfel/src/detector.c
@@ -919,6 +919,7 @@ struct detector *get_detector_geometry(const char *filename,
int reject = 0;
int path_dim;
int dim_dim;
+ int curr_ss;
int x, y, max_fs, max_ss;
int dim_reject = 0;
int dim_dim_reject = 0;
@@ -1186,8 +1187,16 @@ struct detector *get_detector_geometry(const char *filename,
det->dim_dim = dim_dim;
+ curr_ss = 0;
+
for ( i=0; i<det->n_panels; i++ ) {
+ if ( det->panels[i].max_fs-det->panels[i].min_fs+1 !=
+ det->panels[0].max_fs-det->panels[0].min_fs+1 ) {
+ ERROR("All panels should have the same fs extent\n");
+ reject = 1;
+ }
+
if ( det->panels[i ].min_fs < 0 ) {
ERROR("Please specify the minimum FS coordinate for"
" panel %s\n", det->panels[i].name);
@@ -1239,6 +1248,20 @@ struct detector *get_detector_geometry(const char *filename,
/* It's not a problem if "no_index" is still zero */
/* The default transformation matrix is at least valid */
+ det->panels[i].orig_max_fs = det->panels[i].max_fs;
+ det->panels[i].orig_min_fs = det->panels[i].min_fs;
+ det->panels[i].orig_max_ss = det->panels[i].max_ss;
+ det->panels[i].orig_min_ss = det->panels[i].min_ss;
+
+ det->panels[i].w = det->panels[i].max_fs-det->panels[i].min_fs+1;
+ det->panels[i].h = det->panels[i].max_ss-det->panels[i].min_ss+1;
+
+ det->panels[i].min_fs = 0;
+ det->panels[i].max_fs = det->panels[i].w-1;
+ det->panels[i].min_ss = curr_ss;
+ det->panels[i].max_ss = curr_ss+det->panels[i].h-1;
+ curr_ss += det->panels[i].h;
+
if ( det->panels[i].max_fs > max_fs ) {
max_fs = det->panels[i].max_fs;
}
@@ -1246,11 +1269,6 @@ struct detector *get_detector_geometry(const char *filename,
max_ss = det->panels[i].max_ss;
}
- det->panels[i].orig_max_fs = det->panels[i].max_fs;
- det->panels[i].orig_min_fs = det->panels[i].min_fs;
- det->panels[i].orig_max_ss = det->panels[i].max_ss;
- det->panels[i].orig_min_ss = det->panels[i].min_ss;
-
}
for ( i=0; i<det->n_bad; i++ ) {