diff options
Diffstat (limited to 'libcrystfel/src')
-rw-r--r-- | libcrystfel/src/image.h | 6 | ||||
-rw-r--r-- | libcrystfel/src/utils.h | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/libcrystfel/src/image.h b/libcrystfel/src/image.h index dffcdb3a..29ce8ae1 100644 --- a/libcrystfel/src/image.h +++ b/libcrystfel/src/image.h @@ -60,6 +60,7 @@ struct imagefile_field_list; * @SPECTRUM_TOPHAT: A top hat distribution of wavelengths * @SPECTRUM_SASE: A simulated SASE spectrum * @SPECTRUM_TWOCOLOUR: A spectrum containing two peaks + * @SPECTRUM_FROMFILE: An arbitrary spectrum read from input file * * A %SpectrumType represents a type of X-ray energy spectrum to use for * generating simulated data. @@ -67,7 +68,8 @@ struct imagefile_field_list; typedef enum { SPECTRUM_TOPHAT, SPECTRUM_SASE, - SPECTRUM_TWOCOLOUR + SPECTRUM_TWOCOLOUR, + SPECTRUM_FROMFILE } SpectrumType; @@ -124,7 +126,7 @@ typedef struct _imagefeaturelist ImageFeatureList; /* Structure describing a wavelength sample from a spectrum */ struct sample { - double k; + double k; /* 1/m */ double weight; }; diff --git a/libcrystfel/src/utils.h b/libcrystfel/src/utils.h index a759ff15..2c756ad7 100644 --- a/libcrystfel/src/utils.h +++ b/libcrystfel/src/utils.h @@ -185,6 +185,8 @@ static inline int within_tolerance(double a, double b, double percent) /* Photon energy (eV) to wavelength (m) */ #define ph_eV_to_lambda(a) ph_en_to_lambda(eV_to_J(a)) +/* Photon energy (eV) to k (1/m) */ +#define ph_eV_to_k(a) ((a)*ELECTRON_CHARGE/PLANCK/C_VACUO) /* ------------------------------ Message macros ---------------------------- */ |