diff options
Diffstat (limited to 'libcrystfel/src/reflist-utils.c')
-rw-r--r-- | libcrystfel/src/reflist-utils.c | 31 |
1 files changed, 31 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; +} |