aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2016-11-04 13:35:15 +0100
committerThomas White <taw@physics.org>2016-11-04 13:35:15 +0100
commitc4a9925905abc1108b33057240b17913de2e671a (patch)
tree7157d9cc6d4e716d257f0438feeb5398f3a025bb
parent775bbc2d0081978f05d9fa35175bd82cf34c3c40 (diff)
Add (more) warnings about unique axes
-rw-r--r--libcrystfel/src/symmetry.c21
-rw-r--r--libcrystfel/src/symmetry.h8
-rw-r--r--src/ambigator.c2
-rw-r--r--src/get_hkl.c3
-rw-r--r--src/partialator.c1
-rw-r--r--src/pattern_sim.c1
-rw-r--r--src/process_hkl.c1
-rw-r--r--src/render_hkl.c1
8 files changed, 32 insertions, 6 deletions
diff --git a/libcrystfel/src/symmetry.c b/libcrystfel/src/symmetry.c
index 503078a7..d675fb30 100644
--- a/libcrystfel/src/symmetry.c
+++ b/libcrystfel/src/symmetry.c
@@ -3,12 +3,12 @@
*
* Symmetry
*
- * Copyright © 2012-2014 Deutsches Elektronen-Synchrotron DESY,
+ * Copyright © 2012-2016 Deutsches Elektronen-Synchrotron DESY,
* a research centre of the Helmholtz Association.
*
* Authors:
- * 2010-2014 Thomas White <taw@physics.org>
- * 2014 Kenneth Beyerlein <kenneth.beyerlein@desy.de>
+ * 2010-2014,2016 Thomas White <taw@physics.org>
+ * 2014 Kenneth Beyerlein <kenneth.beyerlein@desy.de>
*
* This file is part of CrystFEL.
*
@@ -1088,6 +1088,21 @@ SymOpList *get_pointgroup(const char *sym)
}
+void pointgroup_warning(const char *sym)
+{
+ if ( (strcmp(sym, "m") == 0)
+ || (strcmp(sym, "2/m") == 0)
+ || (strcmp(sym, "2") == 0) )
+ {
+ ERROR("WARNING: You have specified a monoclinic point group "
+ "without a unique axis. The default unique axis is 'c'. "
+ "If you want unique axis b, append '_uab' to your point "
+ "group.\n");
+ }
+
+}
+
+
static void do_op(const IntegerMatrix *op,
signed int h, signed int k, signed int l,
signed int *he, signed int *ke, signed int *le)
diff --git a/libcrystfel/src/symmetry.h b/libcrystfel/src/symmetry.h
index c29164ef..a61ca96f 100644
--- a/libcrystfel/src/symmetry.h
+++ b/libcrystfel/src/symmetry.h
@@ -3,12 +3,12 @@
*
* Symmetry
*
- * Copyright © 2012-2014 Deutsches Elektronen-Synchrotron DESY,
+ * Copyright © 2012-2016 Deutsches Elektronen-Synchrotron DESY,
* a research centre of the Helmholtz Association.
*
* Authors:
- * 2010-2014 Thomas White <taw@physics.org>
- * 2014 Kenneth Beyerlein <kenneth.beyerlein@desy.de>
+ * 2010-2014,2016 Thomas White <taw@physics.org>
+ * 2014 Kenneth Beyerlein <kenneth.beyerlein@desy.de>
*
* This file is part of CrystFEL.
*
@@ -90,6 +90,8 @@ 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 pointgroup_warning(const char *sym);
+
extern void add_symop(SymOpList *ops, IntegerMatrix *m);
extern SymOpList *parse_symmetry_operations(const char *s);
extern char *get_matrix_name(const IntegerMatrix *m, int row);
diff --git a/src/ambigator.c b/src/ambigator.c
index 659b17dc..f7837721 100644
--- a/src/ambigator.c
+++ b/src/ambigator.c
@@ -1099,6 +1099,7 @@ int main(int argc, char *argv[])
if ( s_sym_str == NULL ) {
s_sym_str = strdup("1");
}
+ pointgroup_warning(s_sym_str);
s_sym = get_pointgroup(s_sym_str);
if ( s_sym == NULL ) return 1;
free(s_sym_str);
@@ -1113,6 +1114,7 @@ int main(int argc, char *argv[])
w_sym = NULL;
amb = NULL;
} else {
+ pointgroup_warning(w_sym_str);
w_sym = get_pointgroup(w_sym_str);
free(w_sym_str);
if ( w_sym == NULL ) return 1;
diff --git a/src/get_hkl.c b/src/get_hkl.c
index 62c9e608..d6efe747 100644
--- a/src/get_hkl.c
+++ b/src/get_hkl.c
@@ -561,18 +561,21 @@ int main(int argc, char *argv[])
}
if ( holo_str != NULL ) {
+ pointgroup_warning(holo_str);
holo = get_pointgroup(holo_str);
free(holo_str);
} else {
holo = NULL;
}
if ( mero_str != NULL ) {
+ pointgroup_warning(mero_str);
mero = get_pointgroup(mero_str);
free(mero_str);
} else {
mero = NULL;
}
if ( expand_str != NULL ) {
+ pointgroup_warning(expand_str);
expand = get_pointgroup(expand_str);
free(expand_str);
} else {
diff --git a/src/partialator.c b/src/partialator.c
index 9f50620b..03eaee50 100644
--- a/src/partialator.c
+++ b/src/partialator.c
@@ -962,6 +962,7 @@ int main(int argc, char *argv[])
}
if ( sym_str == NULL ) sym_str = strdup("1");
+ pointgroup_warning(sym_str);
sym = get_pointgroup(sym_str);
free(sym_str);
diff --git a/src/pattern_sim.c b/src/pattern_sim.c
index c60b3280..e1e04789 100644
--- a/src/pattern_sim.c
+++ b/src/pattern_sim.c
@@ -533,6 +533,7 @@ int main(int argc, char *argv[])
}
if ( sym_str == NULL ) sym_str = strdup("1");
+ pointgroup_warning(sym_str);
sym = get_pointgroup(sym_str);
/* sym_str is used below */
diff --git a/src/process_hkl.c b/src/process_hkl.c
index 29ef29a1..d2cf640b 100644
--- a/src/process_hkl.c
+++ b/src/process_hkl.c
@@ -692,6 +692,7 @@ int main(int argc, char *argv[])
}
if ( sym_str == NULL ) sym_str = strdup("1");
+ pointgroup_warning(sym_str);
sym = get_pointgroup(sym_str);
free(sym_str);
diff --git a/src/render_hkl.c b/src/render_hkl.c
index f9398c3d..b0dca996 100644
--- a/src/render_hkl.c
+++ b/src/render_hkl.c
@@ -914,6 +914,7 @@ int main(int argc, char *argv[])
if ( sym_str == NULL ) {
sym_str = strdup("1");
}
+ pointgroup_warning(sym_str);
sym = get_pointgroup(sym_str);
free(sym_str);