aboutsummaryrefslogtreecommitdiff
path: root/src/pattern_sim.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pattern_sim.c')
-rw-r--r--src/pattern_sim.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/pattern_sim.c b/src/pattern_sim.c
index 17aa8030..89413a07 100644
--- a/src/pattern_sim.c
+++ b/src/pattern_sim.c
@@ -493,19 +493,21 @@ int main(int argc, char *argv[])
ERROR("Failed to read beam parameters from '%s'\n", beamfile);
return 1;
}
- free(beamfile);
/* Define image parameters */
image.width = image.det->max_fs + 1;
image.height = image.det->max_ss + 1;
- if (image.beam->photon_energy == 0) {
- ERROR("Invalid photon_energy format in beam file\n")
+ if ( image.beam->photon_energy_from != NULL ) {
+ ERROR("Photon energy must be specified, not taken from the"
+ " HDF5 file. Please alter %s accordingly.\n", beamfile)
return 1;
} else {
- image.lambda = ph_en_to_lambda(eV_to_J(image.beam->photon_energy));
+ double wl = ph_en_to_lambda(eV_to_J(image.beam->photon_energy));
+ image.lambda = wl;
}
image.bw = image.beam->bandwidth;
image.div = image.beam->divergence;
+ free(beamfile);
/* Load unit cell */
input_cell = load_cell_from_pdb(filename);