aboutsummaryrefslogtreecommitdiff
path: root/src/peaks.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-06-07 17:46:25 +0200
committerThomas White <taw@physics.org>2012-02-22 15:27:27 +0100
commit97c023d0947b09b2b7c5182c1938133d91f530a4 (patch)
treed5bfc77a67d54202c2edf94aeda4f5d64605d24e /src/peaks.c
parent150c54e977c2e4c638bfe6d1b155229b3b3f1491 (diff)
Banish find_projected_peaks()
Diffstat (limited to 'src/peaks.c')
-rw-r--r--src/peaks.c80
1 files changed, 0 insertions, 80 deletions
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; fs<image->width; fs++ ) {
- for ( ss=0; ss<image->height; 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)
{