aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/detector.c
diff options
context:
space:
mode:
Diffstat (limited to 'libcrystfel/src/detector.c')
-rw-r--r--libcrystfel/src/detector.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libcrystfel/src/detector.c b/libcrystfel/src/detector.c
index 201b9041..4d008e65 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.00000001;
}
det->n_panels = 0;