aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/detector.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2016-08-10 12:09:33 +0200
committerThomas White <taw@physics.org>2016-08-10 12:09:33 +0200
commitdd5d51821a47a822a3c707143ff3979e566cfbbb (patch)
tree801edd7e95df6e93ae7d1319171c024e8e047bd5 /libcrystfel/src/detector.c
parent838283a04af3338799acdd5eba79ce3b3042635a (diff)
Allow peak table location to be given in geometry file
Diffstat (limited to 'libcrystfel/src/detector.c')
-rw-r--r--libcrystfel/src/detector.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/libcrystfel/src/detector.c b/libcrystfel/src/detector.c
index f90e1a92..4262f4be 100644
--- a/libcrystfel/src/detector.c
+++ b/libcrystfel/src/detector.c
@@ -1051,7 +1051,7 @@ static void parse_toplevel(struct detector *det, struct beam_params *beam,
const char *key, const char *val,
struct rg_definition ***rg_defl,
struct rgc_definition ***rgc_defl, int *n_rg_defs,
- int *n_rgc_defs)
+ int *n_rgc_defs, char **hdf5_peak_path)
{
if ( strcmp(key, "mask_bad") == 0 ) {
@@ -1091,6 +1091,11 @@ static void parse_toplevel(struct detector *det, struct beam_params *beam,
beam->photon_energy_scale = atof(val);
}
+ } else if ( strcmp(key, "peak_info_location") == 0 ) {
+ if ( hdf5_peak_path != NULL ) {
+ *hdf5_peak_path = strdup(val);
+ }
+
} else if (strncmp(key, "rigid_group", 11) == 0
&& strncmp(key, "rigid_group_collection", 22) != 0 ) {
@@ -1179,10 +1184,17 @@ static void find_min_max_d(struct detector *det)
}
}
-
struct detector *get_detector_geometry(const char *filename,
struct beam_params *beam)
{
+ return get_detector_geometry_2(filename, beam, NULL);
+}
+
+
+struct detector *get_detector_geometry_2(const char *filename,
+ struct beam_params *beam,
+ char **hdf5_peak_path)
+{
FILE *fh;
struct detector *det;
char *rval;
@@ -1301,7 +1313,7 @@ struct detector *get_detector_geometry(const char *filename,
/* This was a top-level option, not handled above. */
parse_toplevel(det, beam, bits[0], bits[2], &rg_defl,
&rgc_defl, &n_rg_definitions,
- &n_rgc_definitions);
+ &n_rgc_definitions, hdf5_peak_path);
for ( i=0; i<n1; i++ ) free(bits[i]);
free(bits);
for ( i=0; i<n2; i++ ) free(path[i]);