aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNadia Zatsepin <zatsepin@dhcpvisitor221031.slac.stanford.edu>2012-10-20 06:34:37 -0700
committerNadia Zatsepin <zatsepin@dhcpvisitor221031.slac.stanford.edu>2012-10-20 06:34:37 -0700
commitb5000a6e66dbc7a0c01f06add3656044aeb8b894 (patch)
treeb0ef8741a9d612d97eead542cd50d61486c415c2
parentd33230479371986bd58fc3ddc129ef91db4868d7 (diff)
Check for nonsensical value of lambda (too high) in HDF5
-rw-r--r--src/im-sandbox.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/im-sandbox.c b/src/im-sandbox.c
index 1a344125..98278571 100644
--- a/src/im-sandbox.c
+++ b/src/im-sandbox.c
@@ -248,8 +248,27 @@ static void process_image(const struct index_args *iargs,
return;
}
}
+
+ if ( image.lambda > 1000 ) {
+ if ( beam != NULL ) {
+ ERROR("Nonsensical wavelength in HDF5."
+ "Using nominal photon energy from beam file: %.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");
+ hdfile_close(hdfile);
+ free_detector_geometry(image.det);
+ return;
+ }
+ }
+
fill_in_values(image.det, hdfile);
+
+
if ( config_cmfilter ) {
filter_cm(&image);
}