aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-07-09 12:01:43 +0200
committerThomas White <taw@physics.org>2020-07-29 18:53:45 +0200
commitfbef32528d3b4b2b2f694aa16d60c53511b1d402 (patch)
tree73fce3701cfc50f2a519fcb0a62de9e9db5f4be7
parente19507ae14b5b9456d6c3379b43ba1ad1b2cc527 (diff)
Add wavelength and electron_voltage, plus units, to geometry file
-rw-r--r--doc/man/crystfel_geometry.518
-rw-r--r--libcrystfel/src/datatemplate.c111
-rw-r--r--libcrystfel/src/datatemplate_priv.h13
-rw-r--r--libcrystfel/src/image.c42
-rw-r--r--libcrystfel/src/utils.h16
-rw-r--r--tests/CMakeLists.txt40
-rw-r--r--tests/gen-ev-test.py14
-rw-r--r--tests/wavelength_geom.c72
-rw-r--r--tests/wavelength_geom.h5bin0 -> 7048 bytes
-rw-r--r--tests/wavelength_geom1.geom11
-rw-r--r--tests/wavelength_geom10.geom11
-rw-r--r--tests/wavelength_geom11.geom11
-rw-r--r--tests/wavelength_geom12.geom11
-rw-r--r--tests/wavelength_geom2.geom11
-rw-r--r--tests/wavelength_geom3.geom11
-rw-r--r--tests/wavelength_geom4.geom11
-rw-r--r--tests/wavelength_geom5.geom11
-rw-r--r--tests/wavelength_geom6.geom11
-rw-r--r--tests/wavelength_geom7.geom11
-rw-r--r--tests/wavelength_geom8.geom11
-rw-r--r--tests/wavelength_geom9.geom11
21 files changed, 428 insertions, 30 deletions
diff --git a/doc/man/crystfel_geometry.5 b/doc/man/crystfel_geometry.5
index 871af139..1abed2cf 100644
--- a/doc/man/crystfel_geometry.5
+++ b/doc/man/crystfel_geometry.5
@@ -273,17 +273,15 @@ See the "examples" folder for some examples (look at the ones ending in .geom).
The geometry file can include information about beam characteristics, using general properties, that can appear anywhere in the geometry file and do not follow the usual panel/property syntax. The following beam properties are supported:
.PD 0
-.IP \fBphoton_energy\fR
+.IP "\fBwavelength \fInnn\fR \fB[m|A]"
+.IP "\fBphoton_energy \fInnn\fR \fB[eV|keV]"
+.IP "\fBelectron_voltage \fInnn\fR \fB[V|kV]"
.PD
-The beam photon energy in eV. You can also specify the HDF5 path to a floating point data block value containing the photon energy in eV. For example: "photon_energy = /LCLS/photon_energy_eV". If the HDF5 file contains more than one event, and the data block is scalar, the photon energy value
-it contains will be used for all events. If, however, the data block is multidimensional and the second dimension is bigger than one, the CrystFEL programs will try to match the content of the data block with the events in the file, assigning the first value in the data block to the first event in the file,
-the second value in the data block to the second event in the file, etc. See also \fBphoton_energy_scale\fR.
-
-.PD 0
-.IP \fBphoton_energy_scale\fR
-.PD
-Sometimes the photon energy value recorded in an HDF5 file differs from the true photon energy value by a multiplication factor. This property defines a correction factor that is applied by the CrystFEL programs. The photon energy value read from a file is multiplied by the value of this property if the property is defined in the geometry file.
-
+These statements specify the incident radiation wavelength. You must include one (not more) of these statements. \fBwavelength\fR specifies the wavelength directly, \fBphoton_energy\fR specifies the energy per photon for electromagnetic radiation (e.g. X-rays), and \fBelectron_voltage\fR specifies the accelerating voltage for an electron beam.
+.IP
+\fInnn\fR can be a literal number, or it can be a header location in the image data file. In the latter case, the program will do what you expect in the case of multi-frame data files, e.g. a scalar value in the metadata will be applied to all frames, or an array of values can be used to provide a separate wavelength for each frame.
+.IP
+Units should be specified after the value (or location). These can be \fBm\fR or \fBA\fR for \fBwavelength\fR, \fBeV\fR or \fBkeV\fR for \fBphoton_energy\fR, and \fBV\fR or \fBkV\fR for \fBelectron_voltage\fR. For \fBphoton_energy\fR, if no units are given then the value will be taken to be in eV.
.SH PEAK INFO LOCATION
diff --git a/libcrystfel/src/datatemplate.c b/libcrystfel/src/datatemplate.c
index e9d98639..e3b44207 100644
--- a/libcrystfel/src/datatemplate.c
+++ b/libcrystfel/src/datatemplate.c
@@ -628,6 +628,102 @@ static int parse_field_bad(struct dt_badregion *badr, const char *key,
}
+static int parse_electron_voltage(const char *val,
+ char **p_from,
+ enum wavelength_unit *punit)
+{
+ char *valcpy;
+ char *sp;
+
+ valcpy = strdup(val);
+ if ( valcpy == NULL ) return 1;
+
+ /* "electron_voltage" directive must have explicit units */
+ sp = strchr(valcpy, ' ');
+ if ( sp == NULL ) {
+ free(valcpy);
+ return 1;
+ }
+
+ if ( strcmp(sp+1, "V") == 0 ) {
+ *punit = WAVELENGTH_ELECTRON_V;
+ } else if ( strcmp(sp+1, "kV") == 0 ) {
+ *punit = WAVELENGTH_ELECTRON_KV;
+ } else {
+ free(valcpy);
+ return 1;
+ }
+
+ sp[0] = '\0';
+ *p_from = valcpy;
+ return 0;
+}
+
+
+static int parse_wavelength(const char *val,
+ char **p_from,
+ enum wavelength_unit *punit)
+{
+ char *valcpy;
+ char *sp;
+
+ valcpy = strdup(val);
+ if ( valcpy == NULL ) return 1;
+
+ /* "wavelength" directive must have explicit units */
+ sp = strchr(valcpy, ' ');
+ if ( sp == NULL ) {
+ free(valcpy);
+ return 1;
+ }
+
+ if ( strcmp(sp+1, "m") == 0 ) {
+ *punit = WAVELENGTH_M;
+ } else if ( strcmp(sp+1, "A") == 0 ) {
+ *punit = WAVELENGTH_A;
+ } else {
+ free(valcpy);
+ return 1;
+ }
+
+ sp[0] = '\0';
+ *p_from = valcpy;
+ return 0;
+}
+
+
+static int parse_photon_energy(const char *val,
+ char **p_from,
+ enum wavelength_unit *punit)
+{
+ char *valcpy;
+ char *sp;
+
+ valcpy = strdup(val);
+ if ( valcpy == NULL ) return 1;
+
+ /* "photon_energy" is the only one of the wavelength
+ * directives which is allowed to not have units */
+ sp = strchr(valcpy, ' ');
+ if ( sp == NULL ) {
+ *punit = WAVELENGTH_PHOTON_EV;
+ } else if ( strcmp(sp+1, "eV") == 0 ) {
+ *punit = WAVELENGTH_PHOTON_EV;
+ sp[0] = '\0';
+ } else if ( strcmp(sp+1, "keV") == 0 ) {
+ *punit = WAVELENGTH_PHOTON_KEV;
+ sp[0] = '\0';
+ } else {
+ /* Unit specified, but unrecognised */
+ free(valcpy);
+ return 1;
+ }
+
+ *p_from = valcpy;
+ return 0;
+}
+
+
static int parse_toplevel(DataTemplate *dt,
const char *key,
const char *val,
@@ -664,8 +760,19 @@ static int parse_toplevel(DataTemplate *dt,
defaults->cnz_offset = atof(val);
} else if ( strcmp(key, "photon_energy") == 0 ) {
- /* Will be expanded when image is loaded */
- dt->wavelength_from = strdup(val);
+ return parse_photon_energy(val,
+ &dt->wavelength_from,
+ &dt->wavelength_unit);
+
+ } else if ( strcmp(key, "electron_voltage") == 0 ) {
+ return parse_electron_voltage(val,
+ &dt->wavelength_from,
+ &dt->wavelength_unit);
+
+ } else if ( strcmp(key, "wavelength") == 0 ) {
+ return parse_wavelength(val,
+ &dt->wavelength_from,
+ &dt->wavelength_unit);
} else if ( strcmp(key, "peak_list") == 0 ) {
dt->peak_list = strdup(val);
diff --git a/libcrystfel/src/datatemplate_priv.h b/libcrystfel/src/datatemplate_priv.h
index e94daf4f..75492db5 100644
--- a/libcrystfel/src/datatemplate_priv.h
+++ b/libcrystfel/src/datatemplate_priv.h
@@ -45,6 +45,17 @@ enum adu_per_unit
};
+enum wavelength_unit
+{
+ WAVELENGTH_M,
+ WAVELENGTH_A,
+ WAVELENGTH_ELECTRON_KV,
+ WAVELENGTH_ELECTRON_V,
+ WAVELENGTH_PHOTON_KEV,
+ WAVELENGTH_PHOTON_EV
+};
+
+
struct dt_rigid_group
{
char *name;
@@ -179,6 +190,8 @@ struct _datatemplate
char *wavelength_from;
double photon_energy_bandwidth; /* Eww */
+ enum wavelength_unit wavelength_unit;
+
unsigned int mask_bad;
unsigned int mask_good;
diff --git a/libcrystfel/src/image.c b/libcrystfel/src/image.c
index cce29f73..47cbfea7 100644
--- a/libcrystfel/src/image.c
+++ b/libcrystfel/src/image.c
@@ -366,25 +366,31 @@ static double get_length(struct image *image, const char *from)
}
-static double get_wavelength(struct image *image, const char *from)
+static double convert_to_m(double val, int units)
{
- char *units;
- double value;
+ switch ( units ) {
+
+ case WAVELENGTH_M :
+ return val;
+
+ case WAVELENGTH_A :
+ return val * 1e-10;
+
+ case WAVELENGTH_PHOTON_EV :
+ return ph_eV_to_lambda(val);
+
+ case WAVELENGTH_PHOTON_KEV :
+ return ph_eV_to_lambda(val*1e3);
+
+ case WAVELENGTH_ELECTRON_V :
+ return el_V_to_lambda(val);
+
+ case WAVELENGTH_ELECTRON_KV :
+ return el_V_to_lambda(val*1e3);
- units = get_value_and_units(image, from, &value);
- if ( units == NULL ) {
- /* Default unit is eV */
- return ph_eV_to_lambda(value);
- } else {
- if ( strcmp(units, "A") == 0 ) {
- free(units);
- return value * 1e-10;
- } else {
- ERROR("Invalid wavelength unit '%s'\n", units);
- free(units);
- return NAN;
- }
}
+
+ return NAN;
}
@@ -491,7 +497,9 @@ struct image *image_read(DataTemplate *dtempl, const char *filename,
if ( image == NULL ) return NULL;
/* Wavelength might be needed to create detgeom (adu_per_eV) */
- image->lambda = get_wavelength(image, dtempl->wavelength_from);
+ image->lambda = convert_to_m(get_value(image,
+ dtempl->wavelength_from),
+ dtempl->wavelength_unit);
create_detgeom(image, dtempl);
diff --git a/libcrystfel/src/utils.h b/libcrystfel/src/utils.h
index a43263e0..04208530 100644
--- a/libcrystfel/src/utils.h
+++ b/libcrystfel/src/utils.h
@@ -54,9 +54,12 @@
/* -------------------------- Fundamental constants ------------------------ */
-/* Electron charge in C */
+/* Electron charge (Coulombs) */
#define ELECTRON_CHARGE (1.6021773e-19)
+/* Electron rest mass (kg) */
+#define ELECTRON_MASS (9.1093837015e-31)
+
/* Planck's constant (Js) */
#define PLANCK (6.62606896e-34)
@@ -194,6 +197,17 @@ static inline int within_tolerance(double a, double b, double percent)
/* Photon energy (eV) to k (1/m) */
#define ph_eV_to_k(a) ((a)*ELECTRON_CHARGE/PLANCK/C_VACUO)
+/* Electron accelerating voltage (V) to wavelength (m) */
+static inline double el_V_to_lambda(double E)
+{
+ double Estar;
+
+ /* Relativistically corrected accelerating voltage */
+ Estar = E * (1.0 + E * ELECTRON_CHARGE/(2.0*ELECTRON_MASS*C_VACUO*C_VACUO));
+
+ return PLANCK / sqrt(2.0*ELECTRON_MASS*ELECTRON_CHARGE*Estar);
+}
+
/* ------------------------------ Message logging ---------------------------- */
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 7c1a7836..23a0c95d 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -158,3 +158,43 @@ target_link_libraries(ev_enum3 ${COMMON_LIBRARIES})
add_test(NAME ev_enum3
COMMAND ev_enum3 ${CMAKE_CURRENT_SOURCE_DIR}/ev_enum3.h5
${CMAKE_CURRENT_SOURCE_DIR}/ev_enum3.geom)
+
+add_executable(wavelength_geom wavelength_geom.c)
+target_include_directories(wavelength_geom PRIVATE ${COMMON_INCLUDES})
+target_link_libraries(wavelength_geom ${COMMON_LIBRARIES})
+add_test(NAME wavelength_geom1
+ COMMAND wavelength_geom ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom.h5
+ ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom1.geom 1e-10)
+add_test(NAME wavelength_geom2
+ COMMAND wavelength_geom ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom.h5
+ ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom2.geom 1.3776e-10)
+add_test(NAME wavelength_geom3
+ COMMAND wavelength_geom ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom.h5
+ ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom3.geom 1.3776e-10)
+add_test(NAME wavelength_geom4
+ COMMAND wavelength_geom ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom.h5
+ ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom4.geom 1.9687e-12)
+add_test(NAME wavelength_geom5
+ COMMAND wavelength_geom ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom.h5
+ ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom5.geom 1.9687e-12)
+add_test(NAME wavelength_geom6
+ COMMAND wavelength_geom ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom.h5
+ ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom6.geom 1.3776e-10)
+add_test(NAME wavelength_geom7
+ COMMAND wavelength_geom ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom.h5
+ ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom7.geom 1.3776e-10)
+add_test(NAME wavelength_geom8
+ COMMAND wavelength_geom ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom.h5
+ ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom8.geom 1.9687e-12)
+add_test(NAME wavelength_geom9
+ COMMAND wavelength_geom ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom.h5
+ ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom9.geom 1.3776e-10)
+add_test(NAME wavelength_geom10
+ COMMAND wavelength_geom ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom.h5
+ ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom10.geom 1.3776e-10)
+add_test(NAME wavelength_geom11
+ COMMAND wavelength_geom ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom.h5
+ ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom11.geom 1.125e-10)
+add_test(NAME wavelength_geom12
+ COMMAND wavelength_geom ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom.h5
+ ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom12.geom 1.125e-10)
diff --git a/tests/gen-ev-test.py b/tests/gen-ev-test.py
index 7300f604..e3cb9924 100644
--- a/tests/gen-ev-test.py
+++ b/tests/gen-ev-test.py
@@ -32,3 +32,17 @@ array = numpy.zeros((1,1), dtype=float)
with h5py.File('tests/ev_enum3.h5', 'w') as fh:
fh.create_dataset('/data/data_array', data=array)
+
+array = numpy.zeros((2,2), dtype=float)
+with h5py.File('tests/wavelength_geom.h5', 'w') as fh:
+ fh.create_dataset('/data/data_array', data=array)
+ dh = fh.create_dataset('/LCLS/photon_energy', (), 'f')
+ dh[()] = 9000.0
+ dh = fh.create_dataset('/LCLS/photon_energyK', (), 'f')
+ dh[()] = 9.0
+ dh = fh.create_dataset('/LCLS/electron_energy', (), 'f')
+ dh[()] = 300000
+ dh = fh.create_dataset('/LCLS/electron_energy2', (), 'f')
+ dh[()] = 300
+ dh = fh.create_dataset('/LCLS/wavelength', (), 'f')
+ dh[()] = 1e-10
diff --git a/tests/wavelength_geom.c b/tests/wavelength_geom.c
new file mode 100644
index 00000000..814e2eb3
--- /dev/null
+++ b/tests/wavelength_geom.c
@@ -0,0 +1,72 @@
+/*
+ * wavelength_geom.c
+ *
+ * Check that wavelength reading works
+ *
+ * Copyright © 2020 Deutsches Elektronen-Synchrotron DESY,
+ * a research centre of the Helmholtz Association.
+ *
+ * Authors:
+ * 2020 Thomas White <taw@physics.org>
+ *
+ * This file is part of CrystFEL.
+ *
+ * CrystFEL is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * CrystFEL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with CrystFEL. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <image.h>
+
+int main(int argc, char *argv[])
+{
+ DataTemplate *dtempl;
+ struct image *image;
+ const char *geom_filename;
+ const char *image_filename;
+ double expected_wavelength_m;
+
+ image_filename = argv[1];
+ geom_filename = argv[2];
+ expected_wavelength_m = atof(argv[3]);
+
+ dtempl = data_template_new_from_file(geom_filename);
+ if ( dtempl == NULL ) {
+ ERROR("Failed to load data template\n");
+ return 1;
+ }
+
+ image = image_read(dtempl, image_filename, NULL);
+ if ( image == NULL ) return 1;
+
+ printf("wavelength = %e\n", image->lambda);
+ printf("should be %e\n", expected_wavelength_m);
+
+ if ( !within_tolerance(image->lambda,
+ expected_wavelength_m,
+ 0.1) ) return 1;
+
+ data_template_free(dtempl);
+
+ return 0;
+}
diff --git a/tests/wavelength_geom.h5 b/tests/wavelength_geom.h5
new file mode 100644
index 00000000..f3b37e0f
--- /dev/null
+++ b/tests/wavelength_geom.h5
Binary files differ
diff --git a/tests/wavelength_geom1.geom b/tests/wavelength_geom1.geom
new file mode 100644
index 00000000..91b87385
--- /dev/null
+++ b/tests/wavelength_geom1.geom
@@ -0,0 +1,11 @@
+wavelength = /LCLS/wavelength m
+panel/min_fs = 0
+panel/min_ss = 1
+panel/max_fs = 0
+panel/max_ss = 1
+panel/corner_x = -100
+panel/corner_y = -100
+panel/clen = 50 mm
+panel/res = 1000000
+panel/adu_per_photon = 1
+panel/data = /data/data_array
diff --git a/tests/wavelength_geom10.geom b/tests/wavelength_geom10.geom
new file mode 100644
index 00000000..a315c458
--- /dev/null
+++ b/tests/wavelength_geom10.geom
@@ -0,0 +1,11 @@
+photon_energy = 9e3 eV
+panel/min_fs = 0
+panel/min_ss = 1
+panel/max_fs = 0
+panel/max_ss = 1
+panel/corner_x = -100
+panel/corner_y = -100
+panel/clen = 50 mm
+panel/res = 1000000
+panel/adu_per_photon = 1
+panel/data = /data/data_array
diff --git a/tests/wavelength_geom11.geom b/tests/wavelength_geom11.geom
new file mode 100644
index 00000000..676dc68a
--- /dev/null
+++ b/tests/wavelength_geom11.geom
@@ -0,0 +1,11 @@
+wavelength = 1.125 A
+panel/min_fs = 0
+panel/min_ss = 1
+panel/max_fs = 0
+panel/max_ss = 1
+panel/corner_x = -100
+panel/corner_y = -100
+panel/clen = 50 mm
+panel/res = 1000000
+panel/adu_per_photon = 1
+panel/data = /data/data_array
diff --git a/tests/wavelength_geom12.geom b/tests/wavelength_geom12.geom
new file mode 100644
index 00000000..b47eb243
--- /dev/null
+++ b/tests/wavelength_geom12.geom
@@ -0,0 +1,11 @@
+wavelength = 1.125e-10 m
+panel/min_fs = 0
+panel/min_ss = 1
+panel/max_fs = 0
+panel/max_ss = 1
+panel/corner_x = -100
+panel/corner_y = -100
+panel/clen = 50 mm
+panel/res = 1000000
+panel/adu_per_photon = 1
+panel/data = /data/data_array
diff --git a/tests/wavelength_geom2.geom b/tests/wavelength_geom2.geom
new file mode 100644
index 00000000..73ef91cc
--- /dev/null
+++ b/tests/wavelength_geom2.geom
@@ -0,0 +1,11 @@
+photon_energy = /LCLS/photon_energy
+panel/min_fs = 0
+panel/min_ss = 1
+panel/max_fs = 0
+panel/max_ss = 1
+panel/corner_x = -100
+panel/corner_y = -100
+panel/clen = 50 mm
+panel/res = 1000000
+panel/adu_per_photon = 1
+panel/data = /data/data_array
diff --git a/tests/wavelength_geom3.geom b/tests/wavelength_geom3.geom
new file mode 100644
index 00000000..bcd890bd
--- /dev/null
+++ b/tests/wavelength_geom3.geom
@@ -0,0 +1,11 @@
+photon_energy = /LCLS/photon_energyK keV
+panel/min_fs = 0
+panel/min_ss = 1
+panel/max_fs = 0
+panel/max_ss = 1
+panel/corner_x = -100
+panel/corner_y = -100
+panel/clen = 50 mm
+panel/res = 1000000
+panel/adu_per_photon = 1
+panel/data = /data/data_array
diff --git a/tests/wavelength_geom4.geom b/tests/wavelength_geom4.geom
new file mode 100644
index 00000000..fa03b724
--- /dev/null
+++ b/tests/wavelength_geom4.geom
@@ -0,0 +1,11 @@
+electron_voltage = /LCLS/electron_energy2 kV
+panel/min_fs = 0
+panel/min_ss = 1
+panel/max_fs = 0
+panel/max_ss = 1
+panel/corner_x = -100
+panel/corner_y = -100
+panel/clen = 50 mm
+panel/res = 1000000
+panel/adu_per_photon = 1
+panel/data = /data/data_array
diff --git a/tests/wavelength_geom5.geom b/tests/wavelength_geom5.geom
new file mode 100644
index 00000000..de26de3b
--- /dev/null
+++ b/tests/wavelength_geom5.geom
@@ -0,0 +1,11 @@
+electron_voltage = /LCLS/electron_energy V
+panel/min_fs = 0
+panel/min_ss = 1
+panel/max_fs = 0
+panel/max_ss = 1
+panel/corner_x = -100
+panel/corner_y = -100
+panel/clen = 50 mm
+panel/res = 1000000
+panel/adu_per_photon = 1
+panel/data = /data/data_array
diff --git a/tests/wavelength_geom6.geom b/tests/wavelength_geom6.geom
new file mode 100644
index 00000000..9ee5dc87
--- /dev/null
+++ b/tests/wavelength_geom6.geom
@@ -0,0 +1,11 @@
+photon_energy = /LCLS/photon_energy eV
+panel/min_fs = 0
+panel/min_ss = 1
+panel/max_fs = 0
+panel/max_ss = 1
+panel/corner_x = -100
+panel/corner_y = -100
+panel/clen = 50 mm
+panel/res = 1000000
+panel/adu_per_photon = 1
+panel/data = /data/data_array
diff --git a/tests/wavelength_geom7.geom b/tests/wavelength_geom7.geom
new file mode 100644
index 00000000..a1c311cf
--- /dev/null
+++ b/tests/wavelength_geom7.geom
@@ -0,0 +1,11 @@
+photon_energy = 9000
+panel/min_fs = 0
+panel/min_ss = 1
+panel/max_fs = 0
+panel/max_ss = 1
+panel/corner_x = -100
+panel/corner_y = -100
+panel/clen = 50 mm
+panel/res = 1000000
+panel/adu_per_photon = 1
+panel/data = /data/data_array
diff --git a/tests/wavelength_geom8.geom b/tests/wavelength_geom8.geom
new file mode 100644
index 00000000..00bdb45a
--- /dev/null
+++ b/tests/wavelength_geom8.geom
@@ -0,0 +1,11 @@
+electron_voltage = 300 kV
+panel/min_fs = 0
+panel/min_ss = 1
+panel/max_fs = 0
+panel/max_ss = 1
+panel/corner_x = -100
+panel/corner_y = -100
+panel/clen = 50 mm
+panel/res = 1000000
+panel/adu_per_photon = 1
+panel/data = /data/data_array
diff --git a/tests/wavelength_geom9.geom b/tests/wavelength_geom9.geom
new file mode 100644
index 00000000..9012b5d6
--- /dev/null
+++ b/tests/wavelength_geom9.geom
@@ -0,0 +1,11 @@
+photon_energy = 9 keV
+panel/min_fs = 0
+panel/min_ss = 1
+panel/max_fs = 0
+panel/max_ss = 1
+panel/corner_x = -100
+panel/corner_y = -100
+panel/clen = 50 mm
+panel/res = 1000000
+panel/adu_per_photon = 1
+panel/data = /data/data_array