From 97c023d0947b09b2b7c5182c1938133d91f530a4 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 7 Jun 2011 17:46:25 +0200 Subject: Banish find_projected_peaks() --- src/peaks.c | 80 ------------------------------------------------------------- 1 file changed, 80 deletions(-) (limited to 'src/peaks.c') diff --git a/src/peaks.c b/src/peaks.c index 2e7e7804..e4a7cfb1 100644 --- a/src/peaks.c +++ b/src/peaks.c @@ -449,86 +449,6 @@ void search_peaks(struct image *image, float threshold, float min_gradient) } -RefList *find_projected_peaks(struct image *image, UnitCell *cell, - int circular_domain, double domain_r) -{ - int fs, ss; - double ax, ay, az; - double bx, by, bz; - double cx, cy, cz; - RefList *reflections; - double alen, blen, clen; - int n_reflections = 0; - - reflections = reflist_new(); - - /* "Borrow" direction values to get reciprocal lengths */ - cell_get_reciprocal(cell, &ax, &ay, &az, &bx, &by, &bz, &cx, &cy, &cz); - alen = modulus(ax, ay, az); - blen = modulus(bx, by, bz); - clen = modulus(cx, cy, cz); - - cell_get_cartesian(cell, &ax, &ay, &az, &bx, &by, &bz, &cx, &cy, &cz); - - fesetround(1); /* Round towards nearest */ - for ( fs=0; fswidth; fs++ ) { - for ( ss=0; ssheight; ss++ ) { - - double hd, kd, ld; /* Indices with decimal places */ - double dh, dk, dl; /* Distances in h,k,l directions */ - signed int h, k, l; - struct rvec q; - double dist; - Reflection *refl; - double cur_dist; - - q = get_q(image, fs, ss, NULL, 1.0/image->lambda); - - hd = q.u * ax + q.v * ay + q.w * az; - kd = q.u * bx + q.v * by + q.w * bz; - ld = q.u * cx + q.v * cy + q.w * cz; - - h = lrint(hd); - k = lrint(kd); - l = lrint(ld); - - dh = hd - h; - dk = kd - k; - dl = ld - l; - - if ( circular_domain ) { - /* Circular integration domain */ - dist = sqrt(pow(dh*alen, 2.0) + pow(dk*blen, 2.0) - + pow(dl*clen, 2.0)); - if ( dist > domain_r ) continue; - } else { - /* "Crystallographic" integration domain */ - dist = sqrt(pow(dh, 2.0) + pow(dk, 2.0) + pow(dl, 2.0)); - if ( dist > domain_r ) continue; - } - - refl = find_refl(reflections, h, k, l); - if ( refl != NULL ) { - cur_dist = get_excitation_error(refl); - if ( dist < cur_dist ) { - set_detector_pos(refl, dist, fs, ss); - } - } else { - Reflection *new; - new = add_refl(reflections, h, k, l); - set_detector_pos(new, dist, fs, ss); - n_reflections++; - } - - } - } - - optimise_reflist(reflections); - - return reflections; -} - - int peak_sanity_check(struct image *image, UnitCell *cell, int circular_domain, double domain_r) { -- cgit v1.2.3