From dd5d51821a47a822a3c707143ff3979e566cfbbb Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 10 Aug 2016 12:09:33 +0200 Subject: Allow peak table location to be given in geometry file --- libcrystfel/src/detector.c | 18 +++++++++++++++--- libcrystfel/src/detector.h | 4 ++++ 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'libcrystfel') 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,9 +1184,16 @@ 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; @@ -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