From 285cb2d55a9888083ab0224903f756c4c291c5a6 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 14 Mar 2012 15:29:51 +0100 Subject: check_hkl: Fix inaccurate calculation of redundancy --- src/check_hkl.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/src/check_hkl.c b/src/check_hkl.c index fa5fb0b7..649b86af 100644 --- a/src/check_hkl.c +++ b/src/check_hkl.c @@ -84,9 +84,10 @@ static void plot_shells(RefList *list, UnitCell *cell, const SymOpList *sym, int i; FILE *fh; double snr_total = 0; - int nmeas = 0; + int nrefl = 0; int nmeastot = 0; int nout = 0; + int nsilly = 0; Reflection *refl; RefListIterator *iter; RefList *counted; @@ -193,13 +194,15 @@ static void plot_shells(RefList *list, UnitCell *cell, const SymOpList *sym, refl = next_refl(refl, iter) ) { signed int h, k, l; - double d; + double d, val, esd; int bin; int j; get_indices(refl, &h, &k, &l); d = resolution(cell, h, k, l) * 2.0; + val = get_intensity(refl); + esd = get_esd_intensity(refl); bin = -1; for ( j=0; j = %f\n", snr_total/(double)nmeas); + STATUS("overall = %f\n", snr_total/(double)nrefl); STATUS("%i measurements in total.\n", nmeastot); - STATUS("%i reflections in total.\n", nmeas); + STATUS("%i reflections in total.\n", nrefl); if ( nout ) { STATUS("Warning; %i reflections outside resolution range.\n", nout); } + if ( nsilly ) { + STATUS("Warning; %i reflections had infinite or invalid values" + " of I/sigma(I).\n", nsilly); + } + + fprintf(fh, "1/d centre # refs Possible Compl " "Meas Red SNR Std dev Mean\n"); for ( i=0; i