aboutsummaryrefslogtreecommitdiff
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
parent4e014737a3546ab9e999fb47ba7184fcb368a88e (diff)
Add divergence to beam properties
-rw-r--r--doc/examples/lcls-dec.beam3
-rw-r--r--doc/examples/lcls-june.beam3
-rw-r--r--doc/examples/lcls-xpp-estimate.beam3
-rw-r--r--src/beam-parameters.c7
-rw-r--r--src/beam-parameters.h1
5 files changed, 17 insertions, 0 deletions
diff --git a/doc/examples/lcls-dec.beam b/doc/examples/lcls-dec.beam
index 59b8f8f6..21304711 100644
--- a/doc/examples/lcls-dec.beam
+++ b/doc/examples/lcls-dec.beam
@@ -12,6 +12,9 @@ beam/photon_energy = 2000.0
; distribution with this as its (full) width.
beam/bandwidth = 0.001
+; Beam divergence in radians
+beam/divergence = 0.001
+
; Detector's quantum efficiency
detector/dqe = 0.9
diff --git a/doc/examples/lcls-june.beam b/doc/examples/lcls-june.beam
index db4ef84b..37e4c3ef 100644
--- a/doc/examples/lcls-june.beam
+++ b/doc/examples/lcls-june.beam
@@ -12,6 +12,9 @@ beam/photon_energy = 2000.0
; distribution with this as its (full) width.
beam/bandwidth = 0.001
+; Beam divergence in radians
+beam/divergence = 0.001
+
; Detector's quantum efficiency
detector/dqe = 0.9
diff --git a/doc/examples/lcls-xpp-estimate.beam b/doc/examples/lcls-xpp-estimate.beam
index 0fe866d6..c9f3a498 100644
--- a/doc/examples/lcls-xpp-estimate.beam
+++ b/doc/examples/lcls-xpp-estimate.beam
@@ -12,6 +12,9 @@ beam/photon_energy = 8000.0
; distribution with this as its (full) width.
beam/bandwidth = 0.001
+; Beam divergence in radians
+beam/divergence = 0.001
+
; Detector's quantum efficiency
detector/dqe = 1.0
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" */