From e38375cb0af448c3a7f3667594cf06d1117132c7 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 9 Mar 2012 15:58:15 +0100 Subject: Use ADU per eV in geometry file, rather than ADU per photon in beam file Conflicts: src/get_hkl.c tests/morphology_check.c --- src/get_hkl.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/get_hkl.c') diff --git a/src/get_hkl.c b/src/get_hkl.c index 905da569..cec55495 100644 --- a/src/get_hkl.c +++ b/src/get_hkl.c @@ -56,7 +56,7 @@ static void show_help(const char *s) " --noise Add 10%% random noise.\n" "\n" "To calculate Poisson samples accurately, you must also give:\n" -" -b, --beam= Get beam parameters from file.\n" +" --adu-per-photon= Number of ADU per photon.\n" "\n" "You can artificially 'twin' the reflections, or expand them out.\n" " -w, --twin= Generate twinned data according to the given\n" @@ -362,6 +362,8 @@ int main(int argc, char *argv[]) char *beamfile = NULL; struct beam_params *beam = NULL; RefList *input; + double adu_per_photon = 0.0; + int have_adu_per_photon = 0; /* Long options */ const struct option longopts[] = { @@ -375,8 +377,8 @@ int main(int argc, char *argv[]) {"expand", 1, NULL, 'e'}, {"intensities", 1, NULL, 'i'}, {"multiplicity", 0, &config_multi, 1}, - {"beam", 1, NULL, 'b'}, {"trim-centrics", 0, &config_trimc, 1}, + {"adu-per-photon", 1, NULL, 2}, {0, 0, NULL, 0} }; @@ -413,8 +415,9 @@ int main(int argc, char *argv[]) expand_str = strdup(optarg); break; - case 'b' : - beamfile = strdup(optarg); + case 2 : + adu_per_photon = strtof(optarg, NULL); + have_adu_per_photon = 1; break; case 0 : @@ -476,11 +479,11 @@ int main(int argc, char *argv[]) } if ( config_poisson ) { - if ( beam != NULL ) { - poisson_reflections(input, beam->adu_per_photon); + if ( have_adu_per_photon ) { + poisson_reflections(input, adu_per_photon); } else { - ERROR("You must give a beam parameters file in order" - " to calculate Poisson noise.\n"); + ERROR("You must give the number of ADU per photon to " + "use --poisson.\n"); return 1; } } -- cgit v1.2.3