aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2014-08-12 13:37:25 +0200
committerThomas White <taw@physics.org>2014-08-12 13:37:25 +0200
commit1a18ec0d0a4d6ffe90f5e9e4243fa23b871a6875 (patch)
treeba66a546479948d7fb9ac41ce2714117dfba68bd /libcrystfel/src
parenta82278dbdd8311c46676b0921c423934208ec81a (diff)
Add beam/photon_energy_scale
Diffstat (limited to 'libcrystfel/src')
-rw-r--r--libcrystfel/src/beam-parameters.c12
-rw-r--r--libcrystfel/src/beam-parameters.h6
2 files changed, 12 insertions, 6 deletions
diff --git a/libcrystfel/src/beam-parameters.c b/libcrystfel/src/beam-parameters.c
index 617f9061..4b9941ac 100644
--- a/libcrystfel/src/beam-parameters.c
+++ b/libcrystfel/src/beam-parameters.c
@@ -3,12 +3,12 @@
*
* Beam parameters
*
- * Copyright © 2012 Deutsches Elektronen-Synchrotron DESY,
- * a research centre of the Helmholtz Association.
+ * Copyright © 2012-2014 Deutsches Elektronen-Synchrotron DESY,
+ * a research centre of the Helmholtz Association.
*
* Authors:
- * 2010,2012 Thomas White <taw@physics.org>
- * 2012 Chunhong Yoon
+ * 2010,2012,2014 Thomas White <taw@physics.org>
+ * 2012 Chunhong Yoon
*
* This file is part of CrystFEL.
*
@@ -55,6 +55,7 @@ struct beam_params *get_beam_parameters(const char *filename)
b->fluence = -1.0;
b->beam_radius = -1.0;
b->photon_energy = -1.0;
+ b->photon_energy_scale = 1.0;
b->bandwidth = -1.0;
b->divergence = -1.0;
b->profile_radius = -1.0;
@@ -94,6 +95,8 @@ struct beam_params *get_beam_parameters(const char *filename)
} else {
b->photon_energy = atof(bits[2]);
}
+ } else if ( strcmp(bits[0], "beam/photon_energy_scale") == 0 ) {
+ b->photon_energy_scale = atof(bits[2]);
} else if ( strcmp(bits[0], "beam/bandwidth") == 0 ) {
b->bandwidth = atof(bits[2]);
} else if ( strcmp(bits[0], "beam/divergence") == 0 ) {
@@ -161,5 +164,6 @@ void fill_in_beam_parameters(struct beam_params *beam, struct hdfile *f)
{
if ( beam->photon_energy_from != NULL ) {
beam->photon_energy = get_value(f, beam->photon_energy_from);
+ beam->photon_energy *= beam->photon_energy_scale;
}
}
diff --git a/libcrystfel/src/beam-parameters.h b/libcrystfel/src/beam-parameters.h
index bc3708d9..e4085a0b 100644
--- a/libcrystfel/src/beam-parameters.h
+++ b/libcrystfel/src/beam-parameters.h
@@ -3,11 +3,11 @@
*
* Beam parameters
*
- * Copyright © 2013-2013 Deutsches Elektronen-Synchrotron DESY,
+ * Copyright © 2013-2014 Deutsches Elektronen-Synchrotron DESY,
* a research centre of the Helmholtz Association.
*
* Authors:
- * 2010,2012-2013 Thomas White <taw@physics.org>
+ * 2010,2012-2014 Thomas White <taw@physics.org>
* 2012 Chunhong Yoon
*
* This file is part of CrystFEL.
@@ -44,6 +44,8 @@ struct beam_params
double beam_radius; /* metres */
double photon_energy; /* eV per photon */
char *photon_energy_from; /* HDF5 dataset name */
+ double photon_energy_scale; /* Scale factor for photon energy, if the
+ * energy is to be from the HDF5 file */
double bandwidth; /* FWHM(wavelength) over wavelength.
* Note: current simulation code just uses
* a rectangular distribution with this as