diff options
author | Thomas White <taw@physics.org> | 2010-11-16 16:03:22 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:05 +0100 |
commit | cca20bccf70791f7ce9bd27c59a6c048716012fb (patch) | |
tree | 190cc37d1401af72d5914189d7fe411f70165eee | |
parent | a3ce4d1e8356f50e355e71547becfcdc2348be3e (diff) |
check_hkl: Fix completeness
-rw-r--r-- | src/check_hkl.c | 22 |
1 files changed, 12 insertions, 10 deletions
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]++; } |