aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2012-03-09 15:48:41 +0100
committerThomas White <taw@physics.org>2012-03-09 15:48:41 +0100
commit2ac15877ab35dca76569376d180d1bd899e24a54 (patch)
treeb8ca1908e9cb31c13085b2354c010defb32231f3 /libcrystfel/src
parent17b4e2c20a69e4c11cf96fc120541674ff4ec704 (diff)
process_hkl: Add polarisation correction and improved scaling
Diffstat (limited to 'libcrystfel/src')
-rw-r--r--libcrystfel/src/reflist-utils.c31
-rw-r--r--libcrystfel/src/reflist-utils.h2
2 files changed, 33 insertions, 0 deletions
diff --git a/libcrystfel/src/reflist-utils.c b/libcrystfel/src/reflist-utils.c
index 53ab399a..a84371f3 100644
--- a/libcrystfel/src/reflist-utils.c
+++ b/libcrystfel/src/reflist-utils.c
@@ -471,3 +471,34 @@ RefList *res_cutoff(RefList *list, UnitCell *cell, double min, double max)
reflist_free(list);
return new;
}
+
+
+/**
+ * copy_reflist:
+ * @list: A %RefList
+ *
+ * Returns: A copy of %RefList.
+ **/
+RefList *copy_reflist(RefList *list)
+{
+ Reflection *refl;
+ RefListIterator *iter;
+ RefList *new;
+
+ new = reflist_new();
+
+ for ( refl = first_refl(list, &iter);
+ refl != NULL;
+ refl = next_refl(refl, iter) )
+ {
+ signed int h, k, l;
+ Reflection *n;
+
+ get_indices(refl, &h, &k, &l);
+
+ n = add_refl(new, h, k, l);
+ copy_data(n, refl);
+ }
+
+ return new;
+}
diff --git a/libcrystfel/src/reflist-utils.h b/libcrystfel/src/reflist-utils.h
index b12b8dfa..7e0742a9 100644
--- a/libcrystfel/src/reflist-utils.h
+++ b/libcrystfel/src/reflist-utils.h
@@ -61,4 +61,6 @@ extern double max_intensity(RefList *list);
extern RefList *res_cutoff(RefList *list, UnitCell *cell,
double min, double max);
+extern RefList *copy_reflist(RefList *list);
+
#endif /* REFLIST_UTILS_H */