aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2014-10-24 17:49:27 +0200
committerThomas White <taw@physics.org>2014-10-24 17:49:27 +0200
commit2efe30ffd67c7703b074cca5d7e6f194caa7b0ac (patch)
treef002109acd69c1e19246b7e1f508d422b0d3e50d /libcrystfel
parentb91982acc7ba011a343b3021676ae196949228b2 (diff)
Add find_orig_panel() to API
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/detector.c20
-rw-r--r--libcrystfel/src/detector.h3
-rw-r--r--libcrystfel/src/hdf5-file.c20
3 files changed, 22 insertions, 21 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;
diff --git a/libcrystfel/src/detector.h b/libcrystfel/src/detector.h
index 276dd268..1cd4c607 100644
--- a/libcrystfel/src/detector.h
+++ b/libcrystfel/src/detector.h
@@ -189,8 +189,9 @@ extern void record_image(struct image *image, int do_poisson, int background,
gsl_rng *rng, double beam_radius, double nphotons);
extern struct panel *find_panel(struct detector *det, double fs, double ss);
-
extern signed int find_panel_number(struct detector *det, double fs, double ss);
+extern struct panel *find_orig_panel(struct detector *det,
+ double fs, double ss);
extern struct detector *get_detector_geometry(const char *filename,
struct beam_params *beam);
diff --git a/libcrystfel/src/hdf5-file.c b/libcrystfel/src/hdf5-file.c
index 42408fa1..e403e55a 100644
--- a/libcrystfel/src/hdf5-file.c
+++ b/libcrystfel/src/hdf5-file.c
@@ -191,26 +191,6 @@ int hdfile_set_image(struct hdfile *f, const char *path,
}
-/* 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;
-}
-
-
int get_peaks(struct image *image, struct hdfile *f, const char *p)
{
hid_t dh, sh;