aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2013-05-02 17:45:20 +0200
committerThomas White <taw@physics.org>2013-05-02 17:45:20 +0200
commit0897221e282cdfb66f79b9a9539be504574c2a14 (patch)
tree807b16c48c4c922aee7f2f87f1fcb52c8c445abf /libcrystfel/src
parentc6e982e1f966497cf3d8df05f977d3798bf7b1f7 (diff)
compare_hkl: Calculate CCano only from acentric reflections
Diffstat (limited to 'libcrystfel/src')
-rw-r--r--libcrystfel/src/symmetry.c28
-rw-r--r--libcrystfel/src/symmetry.h3
2 files changed, 31 insertions, 0 deletions
diff --git a/libcrystfel/src/symmetry.c b/libcrystfel/src/symmetry.c
index 4fdc13c6..81d87b25 100644
--- a/libcrystfel/src/symmetry.c
+++ b/libcrystfel/src/symmetry.c
@@ -1192,6 +1192,34 @@ static int any_negative(signed int h, signed int k, signed int l)
/**
+ * is_centric:
+ * @h: h index
+ * @k: k index
+ * @l: l index
+ * @ops: A %SymOpList
+ *
+ * A reflection is centric if it is related by symmetry to its Friedel partner.
+ *
+ * Returns: true if @h @k @l is centric in @ops.
+ *
+ **/
+int is_centric(signed int h, signed int k, signed int l, const SymOpList *ops)
+{
+ signed int ha, ka, la;
+ signed int hb, kb, lb;
+
+ get_asymm(ops, h, k, l, &ha, &ka, &la);
+ get_asymm(ops, -h, -k, -l, &hb, &kb, &lb);
+
+ if ( ha != hb ) return 0;
+ if ( ka != kb ) return 0;
+ if ( la != lb ) return 0;
+
+ return 1;
+}
+
+
+/**
* get_asymm:
* @ops: A %SymOpList, usually corresponding to a point group
* @h: index of a reflection
diff --git a/libcrystfel/src/symmetry.h b/libcrystfel/src/symmetry.h
index 68f17991..6bb6210e 100644
--- a/libcrystfel/src/symmetry.h
+++ b/libcrystfel/src/symmetry.h
@@ -80,6 +80,9 @@ extern const char *symmetry_name(const SymOpList *ops);
extern void set_symmetry_name(SymOpList *ops, const char *name);
extern void describe_symmetry(const SymOpList *s);
+extern int is_centric(signed int h, signed int k, signed int l,
+ const SymOpList *ops);
+
extern void add_symop(SymOpList *ops, IntegerMatrix *m);
#endif /* SYMMETRY_H */