aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2014-10-23 13:26:10 +0200
committerThomas White <taw@physics.org>2014-10-23 17:02:33 +0200
commitab4db8ab3ce97ccad7bbad2a8cc6698cdd2d4c2d (patch)
tree8d9944c98aa596428276d2428d3b1257a647e3d7
parent346d484df6d30d27072a3fb881fcc36705505197 (diff)
Improve handling of missing wavelength
-rw-r--r--libcrystfel/src/hdf5-file.c6
-rw-r--r--src/dw-hdfsee.c2
2 files changed, 5 insertions, 3 deletions
diff --git a/libcrystfel/src/hdf5-file.c b/libcrystfel/src/hdf5-file.c
index a0df1fbe..fac07c43 100644
--- a/libcrystfel/src/hdf5-file.c
+++ b/libcrystfel/src/hdf5-file.c
@@ -970,9 +970,9 @@ int hdf5_read(struct hdfile *f, struct image *image, const char *element,
if ( image->lambda > 1000 ) {
/* Error message covers a silly value in the beam file
* or in the HDF5 file. */
- ERROR("Nonsensical wavelength (%e m) for %s.\n",
+ ERROR("WARNING: Missing or nonsensical wavelength "
+ "(%e m) for %s.\n",
image->lambda, image->filename);
- return 1;
}
}
@@ -1610,7 +1610,7 @@ static int get_i_value(struct hdfile *f, const char *name, int *val)
double get_value(struct hdfile *f, const char *name)
{
- double val;
+ double val = 0.0;
get_f_value(f, name, &val);
return val;
}
diff --git a/src/dw-hdfsee.c b/src/dw-hdfsee.c
index c81da1d5..a73b4abf 100644
--- a/src/dw-hdfsee.c
+++ b/src/dw-hdfsee.c
@@ -2438,6 +2438,8 @@ DisplayWindow *displaywindow_open(char *filename, const char *peaks,
dw->image->det = det_geom;
dw->image->beam = beam;
+ dw->image->lambda = 0.0;
+ dw->image->filename = filename;
dw->hdfile = hdfile_open(filename);
if ( dw->hdfile == NULL ) {