Commit 86fa0c2a authored by Thomas White's avatar Thomas White
Browse files

New parameter in beam description files: profile_radius

parent 516dc9e5
......@@ -207,6 +207,13 @@ beam/bandwidth = 0.001
.br
beam/divergence = 0.001
; Reciprocal space 3D profile radius in m^-1. A sphere of this radius surrounds
; each reciprocal space, and if any part of the sphere is inside the excited
; volume of reciprocal space, the reflection will be predicted. You can change
; the prediction of spots by altering this value - larger numbers give more
; spots;
profile_radius = 0.001e9
.SH AUTHOR
This page was written by Thomas White.
......
......@@ -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"
......
......@@ -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 */
};
......
......@@ -276,7 +276,7 @@ static void process_image(const struct index_args *iargs,
/* Calculate orientation matrix (by magic) */
image.div = beam->divergence;
image.bw = beam->bandwidth;
image.profile_radius = 0.0001e9;
image.profile_radius = beam->profile_radius;
index_pattern(&image, cell, indm, iargs->cellr,
config_verbose, iargs->ipriv,
......
......@@ -506,7 +506,7 @@ int main(int argc, char *argv[])
image.lambda = ph_en_to_lambda(eV_to_J(beam->photon_energy));
image.div = beam->divergence;
image.bw = beam->bandwidth;
image.profile_radius = 0.003e9;
image.profile_radius = beam->profile_radius;
image.filename = malloc(256);
image.copyme = NULL;
......
......@@ -481,7 +481,7 @@ int main(int argc, char *argv[])
cur->width = det->max_fs;
cur->height = det->max_ss;
cur->osf = 1.0;
cur->profile_radius = 0.003e9;
cur->profile_radius = beam->profile_radius;
cur->pr_dud = 0;
/* Muppet proofing */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment