diff options
author | Thomas White <taw@physics.org> | 2017-10-18 15:34:22 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2017-10-19 14:16:30 +0200 |
commit | 21181e2de9338859af0f84dd0d42b0d23d22d1bf (patch) | |
tree | bdf0fbde3e65ebbca592434fe775ae7bd07272d3 /src/render_hkl.c | |
parent | 7fe3ad557caa79313ae566c225fb5de7bfcf21bf (diff) |
render_hkl: Use symmetry from file
Diffstat (limited to 'src/render_hkl.c')
-rw-r--r-- | src/render_hkl.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/src/render_hkl.c b/src/render_hkl.c index 3996814a..3952940e 100644 --- a/src/render_hkl.c +++ b/src/render_hkl.c @@ -3,11 +3,11 @@ * * Draw pretty renderings of reflection lists * - * Copyright © 2012-2015 Deutsches Elektronen-Synchrotron DESY, + * Copyright © 2012-2017 Deutsches Elektronen-Synchrotron DESY, * a research centre of the Helmholtz Association. * * Authors: - * 2010-2015 Thomas White <taw@physics.org> + * 2010-2017 Thomas White <taw@physics.org> * * This file is part of CrystFEL. * @@ -757,6 +757,7 @@ int main(int argc, char *argv[]) int r = 0; double boost = 1.0; char *sym_str = NULL; + char *sym_str_fromfile = NULL; SymOpList *sym; char *weighting = NULL; int wght; @@ -916,13 +917,6 @@ int main(int argc, char *argv[]) return 1; } - if ( sym_str == NULL ) { - sym_str = strdup("1"); - } - pointgroup_warning(sym_str); - sym = get_pointgroup(sym_str); - free(sym_str); - if ( weighting == NULL ) { weighting = strdup("I"); } @@ -1003,11 +997,28 @@ int main(int argc, char *argv[]) ERROR("Couldn't load unit cell from %s\n", cellfile); return 1; } - list = read_reflections(infile); + + list = read_reflections_2(infile, &sym_str_fromfile); if ( list == NULL ) { ERROR("Couldn't read file '%s'\n", infile); return 1; } + + if ( sym_str == NULL ) { + if ( sym_str_fromfile != NULL ) { + STATUS("Using symmetry from reflection file: %s\n", + sym_str_fromfile); + sym_str = sym_str_fromfile; + } else { + sym_str = strdup("1"); + } + } + + pointgroup_warning(sym_str); + sym = get_pointgroup(sym_str); + if ( sym == NULL ) return 1; + free(sym_str); + if ( check_list_symmetry(list, sym) ) { ERROR("The input reflection list does not appear to" " have symmetry %s\n", symmetry_name(sym)); |