diff options
author | Thomas White <taw@physics.org> | 2011-07-04 17:50:56 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:31 +0100 |
commit | efd6562f9156ddff2fe073c97b2ddbf25c45688e (patch) | |
tree | 1d0320634e5cacf9130900b6a013010503a34f41 /src/geometry.c | |
parent | b67429762f02d906fdc3ab14da4577c958937679 (diff) |
Separate "refinable" and "scalable" concepts
Diffstat (limited to 'src/geometry.c')
-rw-r--r-- | src/geometry.c | 48 |
1 files changed, 43 insertions, 5 deletions
diff --git a/src/geometry.c b/src/geometry.c index e2454adf..7a11b110 100644 --- a/src/geometry.c +++ b/src/geometry.c @@ -275,11 +275,10 @@ RefList *find_intersections(struct image *image, UnitCell *cell) } -/* Calculate partialities and apply them to the image's raw_reflections, - * while adding to a ReflItemList of the currentl scalable (asymmetric) - * reflections. */ -void update_partialities(struct image *image, const char *sym, - int *n_expected, int *n_found, int *n_notfound) +/* Predict reflections in "image" */ +void predict_corresponding_reflections(struct image *image, const char *sym, + int *n_expected, int *n_found, + int *n_notfound) { Reflection *refl; RefListIterator *iter; @@ -346,3 +345,42 @@ void update_partialities(struct image *image, const char *sym, reflist_free(predicted); } + + +/* Calculate partialities and apply them to the image's raw_reflections */ +void update_partialities(struct image *image, const char *sym) +{ + Reflection *refl; + RefListIterator *iter; + RefList *predicted; + + predicted = find_intersections(image, image->indexed_cell); + + for ( refl = first_refl(image->reflections, &iter); + refl != NULL; + refl = next_refl(refl, iter) ) + { + + Reflection *p_peak; + double r1, r2, p; + signed int h, k, l; + int clamp1, clamp2; + + /* Get predicted indices and location */ + get_symmetric_indices(refl, &h, &k, &l); + + /* Look for this reflection in the pattern */ + p_peak = find_refl(predicted, h, k, l); + if ( p_peak == NULL ) { + set_partial(refl, 0.0, 0.0, 0.0, -1, +1); + continue; + } else { + /* Transfer partiality stuff */ + get_partial(p_peak, &r1, &r2, &p, &clamp1, &clamp2); + set_partial(refl, r1, r2, p, clamp1, clamp2); + } + + } + + reflist_free(predicted); +} |