From cca20bccf70791f7ce9bd27c59a6c048716012fb Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 16 Nov 2010 16:03:22 +0100 Subject: check_hkl: Fix completeness --- src/check_hkl.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src/check_hkl.c') diff --git a/src/check_hkl.c b/src/check_hkl.c index 0870ee69..78e97a3d 100644 --- a/src/check_hkl.c +++ b/src/check_hkl.c @@ -47,7 +47,7 @@ static void show_help(const char *s) } -static void plot_shells(const double *ref1, ReflItemList *items, UnitCell *cell, +static void plot_shells(const double *ref, ReflItemList *items, UnitCell *cell, const char *sym, unsigned int *counts, const double *sigma, double rmin_fix, double rmax_fix) { @@ -61,11 +61,11 @@ static void plot_shells(const double *ref1, ReflItemList *items, UnitCell *cell, double rmins[NBINS]; double rmaxs[NBINS]; double snr[NBINS]; - double den; + double mean[NBINS]; + double var[NBINS]; double rmin, rmax; signed int h, k, l; int i; - int ctot; FILE *fh; double snr_total = 0; int nmeas = 0; @@ -90,6 +90,8 @@ static void plot_shells(const double *ref1, ReflItemList *items, UnitCell *cell, measured[i] = 0; measurements[i] = 0; snr[i] = 0; + var[i] = 0; + mean[i] = 0; } rmin = +INFINITY; @@ -147,18 +149,14 @@ static void plot_shells(const double *ref1, ReflItemList *items, UnitCell *cell, /* Count the number of reflections possible in each shell */ counted = new_list_count(); - for ( h=-50; h<=+50; h++ ) { - for ( k=-50; k<=+50; k++ ) { - for ( l=-50; l<=+50; l++ ) { + for ( h=-150; h<=+150; h++ ) { + for ( k=-150; k<=+150; k++ ) { + for ( l=-150; l<=+150; l++ ) { double d; signed int hs, ks, ls; int bin; - get_asymm(h, k, l, &hs, &ks, &ls, sym); - if ( lookup_count(counted, hs, ks, ls) ) continue; - set_count(counted, hs, ks, ls, 1); - d = resolution(cell, h, k, l) * 2.0; bin = -1; @@ -170,6 +168,10 @@ static void plot_shells(const double *ref1, ReflItemList *items, UnitCell *cell, } if ( bin == -1 ) continue; + get_asymm(h, k, l, &hs, &ks, &ls, sym); + if ( lookup_count(counted, hs, ks, ls) ) continue; + set_count(counted, hs, ks, ls, 1); + possible[bin]++; } -- cgit v1.2.3