diff options
-rw-r--r-- | src/im-sandbox.c | 19 |
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); } |