aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/detector.c
diff options
context:
space:
mode:
authorValerio Mariani <valerio.mariani@desy.de>2014-03-25 17:35:07 +0100
committerThomas White <taw@physics.org>2014-09-05 18:01:52 +0200
commitc194bf7746e3635571808856f29434499eec55b7 (patch)
tree6e52ae148b10bf46c4ca97badb06b2cfd44a55ed /libcrystfel/src/detector.c
parentc7e4b7acbd624723c5973431c0101fe92bc3089d (diff)
Refactoring of peaks and reflections I/O
Diffstat (limited to 'libcrystfel/src/detector.c')
-rw-r--r--libcrystfel/src/detector.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/libcrystfel/src/detector.c b/libcrystfel/src/detector.c
index 4681ab28..a7829474 100644
--- a/libcrystfel/src/detector.c
+++ b/libcrystfel/src/detector.c
@@ -1488,3 +1488,43 @@ void mark_resolution_range_as_bad(struct image *image,
}
}
+
+
+extern int single_source (struct detector *det, char *element)
+{
+ int pi;
+ char *first_datafrom = NULL;
+ char *curr_datafrom = NULL;
+
+ if ( det->panels[0].data_from == NULL ) {
+ if ( element != NULL ) {
+ first_datafrom = strdup(element);
+ } else {
+ first_datafrom = strdup("/data/data");
+ }
+ } else {
+ first_datafrom = strdup(det->panels[0].data_from);
+ }
+
+ for ( pi=1;pi<det->n_panels;pi++ ) {
+
+ if ( det->panels[pi].data_from == NULL ) {
+ if ( element != NULL ) {
+ curr_datafrom = strdup(element);
+ } else {
+ curr_datafrom = strdup("/data/data");
+ }
+ } else {
+ curr_datafrom = strdup(det->panels[pi].data_from);
+ }
+
+ if ( strcmp(curr_datafrom, first_datafrom) != 0 ) {
+ return 0;
+ }
+ }
+
+ free(first_datafrom);
+ free(curr_datafrom);
+
+ return 1;
+}