diff options
Diffstat (limited to 'libcrystfel/src/beam-parameters.c')
-rw-r--r-- | libcrystfel/src/beam-parameters.c | 9 |
1 files changed, 9 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" |