aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/index.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2017-09-22 11:13:30 +0200
committerThomas White <taw@physics.org>2017-09-22 11:13:30 +0200
commit9f265dd89b1fbb1db5f0d5998a85eebc5514ed5b (patch)
tree31369e68ab5224d6d157d1b079ec6237a8dd4584 /libcrystfel/src/index.c
parent855be9e57a660473ae43a189d6e8f2cb792321b3 (diff)
If no cell params or lattice type, set nocell/nolatt at top level
Another thing that the indexing engines don't need to be repsonsible for.
Diffstat (limited to 'libcrystfel/src/index.c')
-rw-r--r--libcrystfel/src/index.c33
1 files changed, 30 insertions, 3 deletions
diff --git a/libcrystfel/src/index.c b/libcrystfel/src/index.c
index 17153976..3e50b664 100644
--- a/libcrystfel/src/index.c
+++ b/libcrystfel/src/index.c
@@ -301,6 +301,9 @@ IndexingPrivate *setup_indexing(const char *method_list, UnitCell *cell,
}
if ( cell == NULL ) {
+
+ int warn = 0;
+
if ( (flags & INDEXING_CHECK_CELL_COMBINATIONS)
|| (flags & INDEXING_CHECK_CELL_COMBINATIONS) )
{
@@ -310,6 +313,33 @@ IndexingPrivate *setup_indexing(const char *method_list, UnitCell *cell,
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;
+ warn = 1;
+ }
+ }
+ if ( warn ) {
+ ERROR("WARNING: Forcing all indexing methods to use "
+ "\"-nolatt\", because reference Bravais lattice "
+ "type was not given.\n");
+ }
+ }
+
+ if ( !cell_has_parameters(cell) ) {
+ int warn = 0;
+ for ( i=0; i<n; i++ ) {
+ 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 "
+ "\"-nocell\", because reference cell parameters "
+ "were not given.\n");
+ }
}
ipriv = malloc(sizeof(struct _indexingprivate));
@@ -332,9 +362,6 @@ IndexingPrivate *setup_indexing(const char *method_list, UnitCell *cell,
for ( j=0; j<i; j++ ) {
if ( methods[i] == methods[j] ) {
ERROR("Duplicate indexing method.\n");
- ERROR("Have you specified some flags which "
- "aren't accepted by one of your "
- "chosen indexing methods?\n");
return NULL;
}
}