aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2017-10-19 13:39:33 +0200
committerThomas White <taw@physics.org>2017-10-19 14:16:30 +0200
commit0699322f993df4319f09af717ee6cd3c1038d6a0 (patch)
tree1d34f5831e5e551605b668cb231c488220f63e4c
parentb68dee1c8fab406095c16baa27aba3cad8ae6260 (diff)
pattern_sim: Use symmetry from file
-rw-r--r--src/pattern_sim.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/pattern_sim.c b/src/pattern_sim.c
index 347dd618..ca7862da 100644
--- a/src/pattern_sim.c
+++ b/src/pattern_sim.c
@@ -633,11 +633,6 @@ int main(int argc, char *argv[])
free(template_file);
}
- if ( sym_str == NULL ) sym_str = strdup("1");
- pointgroup_warning(sym_str);
- sym = get_pointgroup(sym_str);
- /* sym_str is used below */
-
if ( grad_str == NULL ) {
STATUS("You didn't specify a gradient calculation method, so"
" I'm using the 'mosaic' method, which is fastest.\n");
@@ -720,16 +715,35 @@ int main(int argc, char *argv[])
phases = NULL;
flags = NULL;
+ if ( sym_str == NULL ) sym_str = strdup("1");
+ pointgroup_warning(sym_str);
+ sym = get_pointgroup(sym_str);
+
} else {
RefList *reflections;
+ char *sym_str_fromfile = NULL;
- reflections = read_reflections(intfile);
+ reflections = read_reflections_2(intfile, &sym_str_fromfile);
if ( reflections == NULL ) {
ERROR("Problem reading input file %s\n", intfile);
return 1;
}
+ /* If we don't have a point group yet, and if the file provides
+ * one, use the one from the file */
+ if ( (sym_str == NULL) && (sym_str_fromfile != NULL) ) {
+ sym_str = sym_str_fromfile;
+ STATUS("Using symmetry from reflection file: %s\n",
+ sym_str);
+ }
+
+ /* If we still don't have a point group, use "1" */
+ if ( sym_str == NULL ) sym_str = strdup("1");
+
+ pointgroup_warning(sym_str);
+ sym = get_pointgroup(sym_str);
+
if ( grad == GRADIENT_PHASED ) {
phases = phases_from_list(reflections);
} else {