aboutsummaryrefslogtreecommitdiff
path: root/src/pattern_sim.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2014-09-09 10:38:56 +0200
committerThomas White <taw@physics.org>2014-09-09 10:42:47 +0200
commit3f8ab3da1cbca9ab821dfa8608bfb7389b99739f (patch)
treeaacdd4d5005e323f30aaba9f75843d981139a35b /src/pattern_sim.c
parent2f789e6e769f3521e8925c082cf81eddb30f33fe (diff)
pattern_sim: Fix handling of centric reflections
Diffstat (limited to 'src/pattern_sim.c')
-rw-r--r--src/pattern_sim.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/pattern_sim.c b/src/pattern_sim.c
index 2cbb616e..0889697d 100644
--- a/src/pattern_sim.c
+++ b/src/pattern_sim.c
@@ -100,22 +100,27 @@ static void show_help(const char *s)
}
-static double *intensities_from_list(RefList *list)
+static double *intensities_from_list(RefList *list, SymOpList *sym)
{
Reflection *refl;
RefListIterator *iter;
double *out = new_arr_intensity();
+ SymOpMask *m = new_symopmask(sym);
+ int neq = num_equivs(sym, NULL);
for ( refl = first_refl(list, &iter);
refl != NULL;
refl = next_refl(refl, iter) ) {
signed int h, k, l;
+ int eps;
double intensity = get_intensity(refl);
get_indices(refl, &h, &k, &l);
+ special_position(sym, m, h, k, l);
+ eps = neq / num_equivs(sym, m);
- set_arr_intensity(out, h, k, l, intensity);
+ set_arr_intensity(out, h, k, l, intensity / eps);
}
@@ -529,7 +534,7 @@ int main(int argc, char *argv[])
} else {
phases = NULL;
}
- intensities = intensities_from_list(reflections);
+ intensities = intensities_from_list(reflections, sym);
phases = phases_from_list(reflections);
flags = flags_from_list(reflections);