aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/detector.c17
-rw-r--r--src/detector.h2
2 files changed, 19 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;
diff --git a/src/detector.h b/src/detector.h
index 0ceff341..79c61761 100644
--- a/src/detector.h
+++ b/src/detector.h
@@ -93,6 +93,8 @@ extern void record_image(struct image *image, int do_poisson);
extern struct panel *find_panel(struct detector *det, double fs, double ss);
+extern int find_panel_number(struct detector *det, int fs, int ss);
+
extern struct detector *get_detector_geometry(const char *filename);
extern void free_detector_geometry(struct detector *det);