aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2012-07-26 16:14:42 -0700
committerThomas White <taw@bitwiz.org.uk>2012-07-26 16:14:42 -0700
commit86fa0c2abf6e1399e5c2751f64cf4c19c912aedf (patch)
tree1b35ce3539bbda36f4697de5a6586c9d6458bdaf /libcrystfel/src
parent516dc9e50975ef245f7367b35eb038787f81708c (diff)
New parameter in beam description files: profile_radius
Diffstat (limited to 'libcrystfel/src')
-rw-r--r--libcrystfel/src/beam-parameters.c9
-rw-r--r--libcrystfel/src/beam-parameters.h2
2 files changed, 11 insertions, 0 deletions
diff --git a/libcrystfel/src/beam-parameters.c b/libcrystfel/src/beam-parameters.c
index bc5ee67c..3d6dc346 100644
--- a/libcrystfel/src/beam-parameters.c
+++ b/libcrystfel/src/beam-parameters.c
@@ -55,6 +55,7 @@ struct beam_params *get_beam_parameters(const char *filename)
b->photon_energy = -1.0;
b->bandwidth = -1.0;
b->divergence = -1.0;
+ b->profile_radius = -1.0;
do {
@@ -90,6 +91,8 @@ struct beam_params *get_beam_parameters(const char *filename)
b->bandwidth = atof(bits[2]);
} else if ( strcmp(bits[0], "beam/divergence") == 0 ) {
b->divergence = atof(bits[2]);
+ } else if ( strcmp(bits[0], "profile_radius") == 0 ) {
+ b->profile_radius = atof(bits[2]);
} else {
ERROR("Unrecognised field '%s'\n", bits[0]);
}
@@ -123,6 +126,12 @@ struct beam_params *get_beam_parameters(const char *filename)
ERROR("Invalid or unspecified value for 'beam/divergence'.\n");
reject = 1;
}
+ if ( b->profile_radius < 0.0 ) {
+ ERROR("WARNING: Invalid or unspecified value for"
+ "'profile_radius' in the beam parameters file.\n");
+ ERROR("Using the default value of 0.001 nm^-1.\n");
+ b->profile_radius = 0.001e9;
+ }
if ( reject ) {
ERROR("Please fix the above problems with the beam"
diff --git a/libcrystfel/src/beam-parameters.h b/libcrystfel/src/beam-parameters.h
index fe3d3c56..133e041b 100644
--- a/libcrystfel/src/beam-parameters.h
+++ b/libcrystfel/src/beam-parameters.h
@@ -44,6 +44,8 @@ struct beam_params
* a rectangular distribution with this as
* its (full) width. */
double divergence; /* divergence (radians) */
+
+ double profile_radius; /* Reciprocal space size of a reflection */
};