aboutsummaryrefslogtreecommitdiff
path: root/src/process_hkl.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-10-25 16:00:23 +0200
committerThomas White <taw@physics.org>2012-02-22 15:27:03 +0100
commit380ec553c04576fc3dc4c816127078d3c2cf9e32 (patch)
tree7f2e4a384bf1ed2285c15817fbbfe46c1add1d64 /src/process_hkl.c
parenta1408ca8460ef486730b4e5ce11cfca2504edf3b (diff)
Read beam parameters from file (where appropriate)
Diffstat (limited to 'src/process_hkl.c')
-rw-r--r--src/process_hkl.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/process_hkl.c b/src/process_hkl.c
index 14acd6b9..22cb8016 100644
--- a/src/process_hkl.c
+++ b/src/process_hkl.c
@@ -27,6 +27,7 @@
#include "reflections.h"
#include "symmetry.h"
#include "stream.h"
+#include "beam-parameters.h"
/* Number of divisions for intensity histograms */
@@ -44,6 +45,7 @@ static void show_help(const char *s)
" -o, --output=<filename> Specify output filename for merged intensities\n"
" (don't specify for no output).\n"
" -p, --pdb=<filename> PDB file to use (default: molecule.pdb).\n"
+" -b, --beam=<file> Get beam parameters from file (used for sigmas).\n"
"\n"
" --max-only Take the integrated intensity to be equal to the\n"
" maximum intensity measured for that reflection.\n"
@@ -564,6 +566,7 @@ int main(int argc, char *argv[])
ReflItemList *reference_items;
double *reference_i;
FILE *outfh = NULL;
+ struct beam_params *beam = NULL;
/* Long options */
const struct option longopts[] = {
@@ -582,6 +585,7 @@ int main(int argc, char *argv[])
{"rmerge", 0, &config_rmerge, 1},
{"outstream", 1, NULL, 'a'},
{"reference", 1, NULL, 'r'},
+ {"beam", 1, NULL, 'b'},
{0, 0, NULL, 0}
};
@@ -630,6 +634,15 @@ int main(int argc, char *argv[])
outstream = strdup(optarg);
break;
+ case 'b' :
+ beam = get_beam_parameters(optarg);
+ if ( beam == NULL ) {
+ ERROR("Failed to load beam parameters"
+ " from '%s'\n", optarg);
+ return 1;
+ }
+ break;
+
case 0 :
break;
@@ -758,7 +771,19 @@ int main(int argc, char *argv[])
}
if ( output != NULL ) {
- write_reflections(output, observed, model, NULL, counts, cell);
+
+ double adu_per_photon;
+
+ if ( beam == NULL ) {
+ adu_per_photon = 167.0;
+ STATUS("No beam parameters file provided (use -b), "
+ "so I'm assuming 167.0 ADU per photon.\n");
+ } else {
+ adu_per_photon = beam->adu_per_photon;
+ }
+
+ write_reflections(output, observed, model, NULL, counts, cell,
+ adu_per_photon);
}
if ( config_rmerge ) {