aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/utils.h
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2012-03-09 15:58:15 +0100
committerThomas White <taw@physics.org>2012-03-09 15:58:15 +0100
commite38375cb0af448c3a7f3667594cf06d1117132c7 (patch)
treef23e49509f032a84d3f774846106755beea64160 /libcrystfel/src/utils.h
parentbe33bf078a8ed1ec4c5439095285add97b823fd1 (diff)
Use ADU per eV in geometry file, rather than ADU per photon in beam file
Conflicts: src/get_hkl.c tests/morphology_check.c
Diffstat (limited to 'libcrystfel/src/utils.h')
-rw-r--r--libcrystfel/src/utils.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/libcrystfel/src/utils.h b/libcrystfel/src/utils.h
index 8d5ee479..8c11abd6 100644
--- a/libcrystfel/src/utils.h
+++ b/libcrystfel/src/utils.h
@@ -186,6 +186,12 @@ static inline int within_tolerance(double a, double b, double percent)
/* Joules to eV */
#define J_to_eV(a) ((a)/ELECTRON_CHARGE)
+/* Photon wavelength (m) to energy (eV) */
+#define ph_lambda_to_eV(a) J_to_eV(ph_lambda_to_en(a))
+
+/* Photon energy (eV) to wavelength (m) */
+#define ph_eV_to_lambda(a) ph_en_to_lambda(eV_to_J(a))
+
#define UNUSED __attribute__((unused))