aboutsummaryrefslogtreecommitdiff
path: root/src/pattern_sim.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-11-15 16:04:46 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:40 +0100
commit2c238039c2efda1788ea72c9fb41ff354acc8e97 (patch)
tree34c30c1a29e5bbbc50d25cb62aabe05cb196abb1 /src/pattern_sim.c
parent3c896e8741763b66fa056d6c8d79557225e66ad2 (diff)
Move the "indexed reflection array" thing to where it can't do any harm
Diffstat (limited to 'src/pattern_sim.c')
-rw-r--r--src/pattern_sim.c71
1 files changed, 71 insertions, 0 deletions
diff --git a/src/pattern_sim.c b/src/pattern_sim.c
index 758e9c85..88781f15 100644
--- a/src/pattern_sim.c
+++ b/src/pattern_sim.c
@@ -33,6 +33,7 @@
#include "symmetry.h"
#include "reflist.h"
#include "reflist-utils.h"
+#include "pattern_sim.h"
static void show_help(const char *s)
@@ -141,6 +142,76 @@ static void show_details()
}
+static double *intensities_from_list(RefList *list)
+{
+ Reflection *refl;
+ RefListIterator *iter;
+ double *out = new_list_intensity();
+
+ for ( refl = first_refl(list, &iter);
+ refl != NULL;
+ refl = next_refl(refl, iter) ) {
+
+ signed int h, k, l;
+ double intensity = get_intensity(refl);
+
+ get_indices(refl, &h, &k, &l);
+
+ set_intensity(out, h, k, l, intensity);
+
+ }
+
+ return out;
+}
+
+
+static double *phases_from_list(RefList *list)
+{
+ Reflection *refl;
+ RefListIterator *iter;
+ double *out = new_list_phase();
+
+ for ( refl = first_refl(list, &iter);
+ refl != NULL;
+ refl = next_refl(refl, iter) ) {
+
+ signed int h, k, l;
+ double phase = get_phase(refl, NULL);
+
+ get_indices(refl, &h, &k, &l);
+
+ set_phase(out, h, k, l, phase);
+
+ }
+
+ return out;
+
+}
+
+
+static unsigned char *flags_from_list(RefList *list)
+{
+ Reflection *refl;
+ RefListIterator *iter;
+ unsigned char *out = new_list_flag();
+
+ for ( refl = first_refl(list, &iter);
+ refl != NULL;
+ refl = next_refl(refl, iter) ) {
+
+ signed int h, k, l;
+
+ get_indices(refl, &h, &k, &l);
+
+ set_flag(out, h, k, l, 1);
+
+ }
+
+ return out;
+
+}
+
+
static struct quaternion read_quaternion()
{
do {