diff options
author | Thomas White <taw@physics.org> | 2017-09-22 13:17:10 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2017-09-22 13:17:10 +0200 |
commit | 2c25695f9516beb5d27fd6a42696c4af1bec77b5 (patch) | |
tree | 5188623cfa5c7c00cd03abfa3eccd72d182f8c22 | |
parent | e214a0bbb650d036fc08130e6d6104008ecdcb48 (diff) |
Set --no-check-cell if cell is given, but has no parameters
-rw-r--r-- | libcrystfel/src/index.c | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/libcrystfel/src/index.c b/libcrystfel/src/index.c index 3e50b664..ed791ff1 100644 --- a/libcrystfel/src/index.c +++ b/libcrystfel/src/index.c @@ -300,46 +300,51 @@ IndexingPrivate *setup_indexing(const char *method_list, UnitCell *cell, } } - if ( cell == NULL ) { + /* No cell parameters -> no cell checking, no prior cell */ + if ( !cell_has_parameters(cell) ) { int warn = 0; if ( (flags & INDEXING_CHECK_CELL_COMBINATIONS) || (flags & INDEXING_CHECK_CELL_COMBINATIONS) ) { - ERROR("WARNING: Forcing --no-cell-combinations " - "and --no-check-cell because you didn't " - "provide a unit cell.\n"); + ERROR("WARNING: Forcing --no-check-cell because " + "reference unit cell parameters were not " + "given.\n"); flags &= ~INDEXING_CHECK_CELL_COMBINATIONS; flags &= ~INDEXING_CHECK_CELL_AXES; } for ( i=0; i<n; i++ ) { - if ( methods[i] & INDEXING_USE_LATTICE_TYPE ) { - methods[i] &= ~INDEXING_USE_LATTICE_TYPE; + if ( methods[i] & INDEXING_USE_CELL_PARAMETERS ) { + methods[i] &= ~INDEXING_USE_CELL_PARAMETERS; warn = 1; } } if ( warn ) { ERROR("WARNING: Forcing all indexing methods to use " - "\"-nolatt\", because reference Bravais lattice " - "type was not given.\n"); + "\"-nocell\", because reference cell parameters " + "were not given.\n"); } } - if ( !cell_has_parameters(cell) ) { + /* No cell at all -> no prior lattice type */ + if ( cell == NULL ) { + int warn = 0; + for ( i=0; i<n; i++ ) { - if ( methods[i] & INDEXING_USE_CELL_PARAMETERS ) { - methods[i] &= ~INDEXING_USE_CELL_PARAMETERS; + if ( methods[i] & INDEXING_USE_LATTICE_TYPE ) { + methods[i] &= ~INDEXING_USE_LATTICE_TYPE; warn = 1; } } if ( warn ) { ERROR("WARNING: Forcing all indexing methods to use " - "\"-nocell\", because reference cell parameters " - "were not given.\n"); + "\"-nolatt\", because reference Bravais lattice " + "type was not given.\n"); } + } ipriv = malloc(sizeof(struct _indexingprivate)); |