diff options
author | Thomas White <taw@physics.org> | 2016-08-10 12:09:33 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2016-08-10 12:09:33 +0200 |
commit | dd5d51821a47a822a3c707143ff3979e566cfbbb (patch) | |
tree | 801edd7e95df6e93ae7d1319171c024e8e047bd5 /libcrystfel/src | |
parent | 838283a04af3338799acdd5eba79ce3b3042635a (diff) |
Allow peak table location to be given in geometry file
Diffstat (limited to 'libcrystfel/src')
-rw-r--r-- | libcrystfel/src/detector.c | 18 | ||||
-rw-r--r-- | libcrystfel/src/detector.h | 4 |
2 files changed, 19 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]); diff --git a/libcrystfel/src/detector.h b/libcrystfel/src/detector.h index 61fc4901..04e3c1ec 100644 --- a/libcrystfel/src/detector.h +++ b/libcrystfel/src/detector.h @@ -212,6 +212,10 @@ extern int panel_number(struct detector *det, struct panel *p); extern struct detector *get_detector_geometry(const char *filename, struct beam_params *beam); +extern struct detector *get_detector_geometry_2(const char *filename, + struct beam_params *beam, + char **hdf5_peak_path); + extern void free_detector_geometry(struct detector *det); extern struct detector *simple_geometry(const struct image *image, int w, int h); |