From 976170a5a1838077bfb230dfa634ed8310543815 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 20 Sep 2011 16:56:43 +0200 Subject: Simplify compare_hkl and check_hkl, remove second to last use of "list types" --- src/check_hkl.c | 46 ++++++++++++---------------------------------- 1 file changed, 12 insertions(+), 34 deletions(-) (limited to 'src/check_hkl.c') diff --git a/src/check_hkl.c b/src/check_hkl.c index 6eb1d26e..c9d50c20 100644 --- a/src/check_hkl.c +++ b/src/check_hkl.c @@ -54,7 +54,6 @@ static void plot_shells(RefList *list, UnitCell *cell, const SymOpList *sym, double num[NBINS]; int cts[NBINS]; int possible[NBINS]; - unsigned int *counted; unsigned int measurements[NBINS]; unsigned int measured[NBINS]; double total_vol, vol_per_shell; @@ -73,6 +72,7 @@ static void plot_shells(RefList *list, UnitCell *cell, const SymOpList *sym, int nout = 0; Reflection *refl; RefListIterator *iter; + RefList *counted; int hmax, kmax, lmax; double asx, asy, asz; double bsx, bsy, bsz; @@ -100,24 +100,7 @@ static void plot_shells(RefList *list, UnitCell *cell, const SymOpList *sym, mean[i] = 0; } - /* Iterate over all common reflections and calculate min and max - * resolution */ - rmin = +INFINITY; rmax = 0.0; - for ( refl = first_refl(list, &iter); - refl != NULL; - refl = next_refl(refl, iter) ) { - - signed int h, k, l; - double d; - - get_indices(refl, &h, &k, &l); - - d = resolution(cell, h, k, l) * 2.0; - if ( d > rmax ) rmax = d; - if ( d < rmin ) rmin = d; - - } - + resolution_limits(list, cell, &rmin, &rmax); STATUS("1/d goes from %f to %f nm^-1\n", rmin/1e9, rmax/1e9); /* Widen the range just a little bit */ @@ -155,7 +138,7 @@ static void plot_shells(RefList *list, UnitCell *cell, const SymOpList *sym, rmins[NBINS-1]/1e9, rmaxs[NBINS-1]/1e9); /* Count the number of reflections possible in each shell */ - counted = new_list_count(); + counted = reflist_new(); cell_get_reciprocal(cell, &asx, &asy, &asz, &bsx, &bsy, &bsz, &csx, &csy, &csz); @@ -170,7 +153,7 @@ static void plot_shells(RefList *list, UnitCell *cell, const SymOpList *sym, signed int hs, ks, ls; int bin; - d = resolution(cell, h, k, l) * 2.0; + d = 2.0 * resolution(cell, h, k, l); bin = -1; for ( i=0; i = %f\n", snr_total/(double)nmeas); STATUS("%i measurements in total.\n", nmeastot); -- cgit v1.2.3