diff options
author | Thomas White <taw@physics.org> | 2019-04-30 14:43:06 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2019-09-12 16:35:52 +0200 |
commit | 117779c5fd9321b4a262f144798f081321a65a38 (patch) | |
tree | ade953b50ab0ed84527040d7af49a228cb7d6549 /libcrystfel/src/detector.c | |
parent | 10f9432595f5425ff2f8605ea181f7c643ab81ab (diff) |
Avoid duplication of beam and detector parameters for pinkIndexer
Diffstat (limited to 'libcrystfel/src/detector.c')
-rw-r--r-- | libcrystfel/src/detector.c | 14 |
1 files changed, 14 insertions, 0 deletions
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; |