aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-04-24 11:42:58 +0200
committerThomas White <taw@physics.org>2012-02-22 15:27:24 +0100
commite0f621b0fa2094283f9a28155e5fbc75c74bd82c (patch)
tree1ce05cc895cecd76a8b30001af9c0ae5cfb7375c
parent6ae30d0ec2cb6d9db16ce649883f424be3f7a667 (diff)
indexamajig: Complain more loudly about using nominal value, and convert it properly
-rw-r--r--src/hdf5-file.c6
-rw-r--r--src/indexamajig.c4
2 files changed, 7 insertions, 3 deletions
diff --git a/src/hdf5-file.c b/src/hdf5-file.c
index 0ca4f4d8..b8a8bdc3 100644
--- a/src/hdf5-file.c
+++ b/src/hdf5-file.c
@@ -278,9 +278,11 @@ static double get_wavelength(struct hdfile *f)
dh = H5Dopen2(f->fh, "/LCLS/photon_wavelength_nm", H5P_DEFAULT);
if ( dh < 0 ) {
dh = H5Dopen2(f->fh, "/LCLS/photon_wavelength_A", H5P_DEFAULT);
- if ( dh < 0 ) return -1.0;
+ if ( dh < 0 ) {
+ ERROR("Couldn't get photon wavelength from HDF5 file.\n");
+ return -1.0;
+ }
nm = 0;
-
}
r = H5Dread(dh, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL,
diff --git a/src/indexamajig.c b/src/indexamajig.c
index ba921e0d..7da8a280 100644
--- a/src/indexamajig.c
+++ b/src/indexamajig.c
@@ -262,7 +262,9 @@ static void process_image(void *pp, int cookie)
hdf5_read(hdfile, &image, pargs->static_args.config_satcorr);
if ( image.lambda < 0.0 ) {
if ( beam != NULL ) {
- image.lambda = beam->photon_energy;
+ ERROR("Using nominal photon enery of %.2f eV\n",
+ beam->photon_energy);
+ image.lambda = ph_en_to_lambda(eV_to_J(beam->photon_energy));
} else {
ERROR("No wavelength in file, so you need to give "
"a beam parameters file with -b.\n");