aboutsummaryrefslogtreecommitdiff
path: root/src/pattern_sim.c
diff options
context:
space:
mode:
authorChun Hong Yoon <chun.hong.yoon@desy.de>2012-12-13 23:01:54 +0100
committerChun Hong Yoon <chun.hong.yoon@desy.de>2012-12-13 23:01:54 +0100
commit27da7fc3b8c4ae479305d5de996bf8c729fabac3 (patch)
treed93549fe17ffa318f65d6fd7be1487f7b3778f5c /src/pattern_sim.c
parent7e7044535bf08943771c611785e4e16f3be0257b (diff)
more user options for beam photon energy
Diffstat (limited to 'src/pattern_sim.c')
-rw-r--r--src/pattern_sim.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/pattern_sim.c b/src/pattern_sim.c
index 06a1f5e5..17aa8030 100644
--- a/src/pattern_sim.c
+++ b/src/pattern_sim.c
@@ -498,7 +498,12 @@ int main(int argc, char *argv[])
/* Define image parameters */
image.width = image.det->max_fs + 1;
image.height = image.det->max_ss + 1;
- image.lambda = ph_en_to_lambda(eV_to_J(image.beam->photon_energy));
+ if (image.beam->photon_energy == 0) {
+ ERROR("Invalid photon_energy format in beam file\n")
+ return 1;
+ } else {
+ image.lambda = ph_en_to_lambda(eV_to_J(image.beam->photon_energy));
+ }
image.bw = image.beam->bandwidth;
image.div = image.beam->divergence;