From 380ec553c04576fc3dc4c816127078d3c2cf9e32 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 25 Oct 2010 16:00:23 +0200 Subject: Read beam parameters from file (where appropriate) --- src/get_hkl.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'src/get_hkl.c') diff --git a/src/get_hkl.c b/src/get_hkl.c index dba341c6..8a8a71c2 100644 --- a/src/get_hkl.c +++ b/src/get_hkl.c @@ -25,6 +25,7 @@ #include "sfac.h" #include "reflections.h" #include "symmetry.h" +#include "beam-parameters.h" static void show_help(const char *s) @@ -50,6 +51,7 @@ static void show_help(const char *s) " --no-phases Do not try to use phases in the input file.\n" " --multiplicity Multiply intensities by the number of\n" " equivalent reflections.\n" +" -b, --beam= Get beam parameters from file (used for sigmas).\n" ); } @@ -262,6 +264,8 @@ int main(int argc, char *argv[]) ReflItemList *input_items; ReflItemList *write_items; UnitCell *cell = NULL; + double adu_per_photon; + struct beam_params *beam = NULL; /* Long options */ const struct option longopts[] = { @@ -277,6 +281,7 @@ int main(int argc, char *argv[]) {"pdb", 1, NULL, 'p'}, {"no-phases", 0, &config_nophase, 1}, {"multiplicity", 0, &config_multi, 1}, + {"beam", 1, NULL, 'b'}, {0, 0, NULL, 0} }; @@ -317,6 +322,15 @@ int main(int argc, char *argv[]) expand = 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; @@ -407,7 +421,16 @@ int main(int argc, char *argv[]) union_items(write_items, input_items); } - write_reflections(output, write_items, ideal_ref, phases, NULL, cell); + 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, write_items, ideal_ref, phases, NULL, cell, + adu_per_photon); delete_items(input_items); delete_items(write_items); -- cgit v1.2.3