diff options
author | Thomas White <taw@physics.org> | 2010-10-27 11:37:04 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:04 +0100 |
commit | 80e6d044ba9237d2778d91bbb585aa93297a135e (patch) | |
tree | 7f46a6b1149513ffe8e467b6ea8e327a27bf326f /src | |
parent | 4e014737a3546ab9e999fb47ba7184fcb368a88e (diff) |
Add divergence to beam properties
Diffstat (limited to 'src')
-rw-r--r-- | src/beam-parameters.c | 7 | ||||
-rw-r--r-- | src/beam-parameters.h | 1 |
2 files changed, 8 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; diff --git a/src/beam-parameters.h b/src/beam-parameters.h index aec2c6aa..1fadc3f8 100644 --- a/src/beam-parameters.h +++ b/src/beam-parameters.h @@ -27,6 +27,7 @@ struct beam_params * Note: current simulation code just uses * a rectangular distribution with this as * its (full) width. */ + double divergence; /* divergence (radians) */ double dqe; /* Detector DQE (fraction) */ double adu_per_photon; /* Detector "gain" */ |