From 2efe30ffd67c7703b074cca5d7e6f194caa7b0ac Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 24 Oct 2014 17:49:27 +0200 Subject: Add find_orig_panel() to API --- libcrystfel/src/detector.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'libcrystfel/src/detector.c') diff --git a/libcrystfel/src/detector.c b/libcrystfel/src/detector.c index 5dad09d6..5bdfcec2 100644 --- a/libcrystfel/src/detector.c +++ b/libcrystfel/src/detector.c @@ -461,6 +461,26 @@ struct panel *find_panel(struct detector *det, double fs, double ss) } +/* Like find_panel(), but uses the original panel bounds, i.e. referring to + * what's in the HDF5 file */ +struct panel *find_orig_panel(struct detector *det, double fs, double ss) +{ + int p; + + for ( p=0; pn_panels; p++ ) { + if ( (fs >= det->panels[p].orig_min_fs) + && (fs < det->panels[p].orig_max_fs+1) + && (ss >= det->panels[p].orig_min_ss) + && (ss < det->panels[p].orig_max_ss+1) ) + { + return &det->panels[p]; + } + } + + return NULL; +} + + void fill_in_values(struct detector *det, struct hdfile *f, struct event* ev) { int i; -- cgit v1.2.3