From 117779c5fd9321b4a262f144798f081321a65a38 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 30 Apr 2019 14:43:06 +0200 Subject: Avoid duplication of beam and detector parameters for pinkIndexer --- libcrystfel/src/detector.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libcrystfel/src/detector.c') diff --git a/libcrystfel/src/detector.c b/libcrystfel/src/detector.c index 201b9041..aab72341 100644 --- a/libcrystfel/src/detector.c +++ b/libcrystfel/src/detector.c @@ -1070,6 +1070,19 @@ static void parse_toplevel(struct detector *det, struct beam_params *beam, } } + } else if ( strcmp(key, "photon_energy_bandwidth") == 0 ) { + if ( beam != NULL ) { + double v; + char *end; + v = strtod(val, &end); + if ( (val[0] != '\0') && (end[0] == '\0') ) { + beam->bandwidth = v; + } else { + ERROR("Invalid value for " + "photon_energy_bandwidth\n"); + } + } + } else if ( strcmp(key, "photon_energy_scale") == 0 ) { if ( beam != NULL ) { beam->photon_energy_scale = atof(val); @@ -1202,6 +1215,7 @@ struct detector *get_detector_geometry_from_string(const char *string, beam->photon_energy = 0.0; beam->photon_energy_from = NULL; beam->photon_energy_scale = 1.0; + beam->bandwidth = 0.0; } det->n_panels = 0; -- cgit v1.2.3