aboutsummaryrefslogtreecommitdiff
path: root/src/beam-parameters.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-10-27 11:37:04 +0200
committerThomas White <taw@physics.org>2012-02-22 15:27:04 +0100
commit80e6d044ba9237d2778d91bbb585aa93297a135e (patch)
tree7f46a6b1149513ffe8e467b6ea8e327a27bf326f /src/beam-parameters.c
parent4e014737a3546ab9e999fb47ba7184fcb368a88e (diff)
Add divergence to beam properties
Diffstat (limited to 'src/beam-parameters.c')
-rw-r--r--src/beam-parameters.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/beam-parameters.c b/src/beam-parameters.c
index 9f5a0dde..8d34eacf 100644
--- a/src/beam-parameters.c
+++ b/src/beam-parameters.c
@@ -38,6 +38,7 @@ struct beam_params *get_beam_parameters(const char *filename)
b->beam_radius = -1.0;
b->photon_energy = -1.0;
b->bandwidth = -1.0;
+ b->divergence = -1.0;
b->dqe = -1.0;
b->adu_per_photon = -1.0;
b->water_radius = -1.0;
@@ -74,6 +75,8 @@ struct beam_params *get_beam_parameters(const char *filename)
b->photon_energy = atof(bits[2]);
} else if ( strcmp(bits[0], "beam/bandwidth") == 0 ) {
b->bandwidth = atof(bits[2]);
+ } else if ( strcmp(bits[0], "beam/divergence") == 0 ) {
+ b->divergence = atof(bits[2]);
} else if ( strcmp(bits[0], "detector/dqe") == 0 ) {
b->dqe = atof(bits[2]);
} else if ( strcmp(bits[0], "detector/adu_per_photon") == 0 ) {
@@ -109,6 +112,10 @@ struct beam_params *get_beam_parameters(const char *filename)
ERROR("Invalid or unspecified value for 'beam/bandwidth'.\n");
reject = 1;
}
+ if ( b->divergence < 0.0 ) {
+ ERROR("Invalid or unspecified value for 'beam/divergence'.\n");
+ reject = 1;
+ }
if ( b->dqe < 0.0 ) {
ERROR("Invalid or unspecified value for 'detector/dqe'.\n");
reject = 1;