aboutsummaryrefslogtreecommitdiff
path: root/src/detector.c
diff options
context:
space:
mode:
authorRick Kirian <rkirian@asu.edu>2011-03-25 14:44:08 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:23 +0100
commit2c09002652b107e4e5cc85cd75df298c09ce9a4e (patch)
treef6957f3442bb2ecc8e85c72623875ad00d861cf8 /src/detector.c
parent36e8507fe373a466b2e5245fd2e523378f28d254 (diff)
detector.c: add function find_panel_number
Diffstat (limited to 'src/detector.c')
-rw-r--r--src/detector.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/detector.c b/src/detector.c
index c542a5a1..a202d5a3 100644
--- a/src/detector.c
+++ b/src/detector.c
@@ -280,6 +280,23 @@ struct panel *find_panel(struct detector *det, double fs, double ss)
}
+int find_panel_number(struct detector *det, int fs, int ss)
+{
+ int p;
+
+ for ( p=0; p<det->n_panels; p++ ) {
+ if ( (fs >= det->panels[p].min_fs)
+ && (fs <= det->panels[p].max_fs)
+ && (ss >= det->panels[p].min_ss)
+ && (ss <= det->panels[p].max_ss) ) {
+ return p;
+ }
+ }
+
+ return -1;
+}
+
+
void fill_in_values(struct detector *det, struct hdfile *f)
{
int i;