diff options
author | Thomas White <taw@physics.org> | 2014-10-24 17:49:27 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2014-10-24 17:49:27 +0200 |
commit | 2efe30ffd67c7703b074cca5d7e6f194caa7b0ac (patch) | |
tree | f002109acd69c1e19246b7e1f508d422b0d3e50d /libcrystfel/src/detector.c | |
parent | b91982acc7ba011a343b3021676ae196949228b2 (diff) |
Add find_orig_panel() to API
Diffstat (limited to 'libcrystfel/src/detector.c')
-rw-r--r-- | libcrystfel/src/detector.c | 20 |
1 files changed, 20 insertions, 0 deletions
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; p<det->n_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; |