diff options
Diffstat (limited to 'libcrystfel/src')
-rw-r--r-- | libcrystfel/src/xds.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/libcrystfel/src/xds.c b/libcrystfel/src/xds.c index 5d9d4bfa..887ba108 100644 --- a/libcrystfel/src/xds.c +++ b/libcrystfel/src/xds.c @@ -651,8 +651,28 @@ IndexingPrivate *xds_prepare(IndexingMethod *indm, UnitCell *cell, { struct xds_private *xp; - if ( cell == NULL ) { - ERROR("XDS needs a unit cell.\n"); + /* Either cell,latt and cell provided, or nocell-nolatt and no cell + * - complain about anything else. Could figure this out automatically, + * but we'd have to decide whether the user just forgot the cell, or + * forgot "-nolatt", or whatever. */ + if ( ((*indm & INDEXING_USE_LATTICE_TYPE) + || (*indm & INDEXING_USE_CELL_PARAMETERS)) && (cell == NULL) ) { + ERROR("No cell provided. If you wanted to use XDS without " + "prior cell information, use xds-nolatt-nocell.\n"); + return NULL; + } + + if ( (*indm & INDEXING_USE_LATTICE_TYPE) + && !(*indm & INDEXING_USE_CELL_PARAMETERS) ) { + ERROR("Invalid XDS options (-latt-nocell): " + "try xds-nolatt-nocell.\n"); + return NULL; + } + + if ( (*indm & INDEXING_USE_CELL_PARAMETERS) + && !(*indm & INDEXING_USE_LATTICE_TYPE) ) { + ERROR("Invalid XDS options (-cell-nolatt): " + "try xds-nolatt-nocell.\n"); return NULL; } |