aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-11-01 11:04:46 +0100
committerThomas White <taw@physics.org>2018-11-02 14:24:55 +0100
commit02675d2a6e77c58cefec4b9fb49332824bfb8ea1 (patch)
tree5a08668e7b8912c6d953ed7ccd4859d8634f31d8 /libcrystfel
parented94e880540cf1cbc3903ec5ec1489e2b67ac0ca (diff)
Change a couple of important asserts to if statements
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/cell-utils.c5
-rw-r--r--libcrystfel/src/index.c6
2 files changed, 9 insertions, 2 deletions
diff --git a/libcrystfel/src/cell-utils.c b/libcrystfel/src/cell-utils.c
index 5465052c..7b1984bb 100644
--- a/libcrystfel/src/cell-utils.c
+++ b/libcrystfel/src/cell-utils.c
@@ -208,7 +208,10 @@ int right_handed(UnitCell *cell)
rh_direct = aCb_dot_c > 0.0;
- assert(rh_reciprocal == rh_direct);
+ if ( rh_reciprocal != rh_direct ) {
+ ERROR("Whoops, reciprocal and real space handedness are "
+ "not the same!\n");
+ }
return rh_direct;
}
diff --git a/libcrystfel/src/index.c b/libcrystfel/src/index.c
index d75f28ed..1476304d 100644
--- a/libcrystfel/src/index.c
+++ b/libcrystfel/src/index.c
@@ -606,7 +606,11 @@ static int try_indexer(struct image *image, IndexingMethod indm,
}
/* Stop a really difficult to debug situation in its tracks */
- assert(image->n_crystals - n_before == r);
+ if ( image->n_crystals - n_before != r ) {
+ ERROR("Whoops, indexer didn't return the right number "
+ "of crystals!\n");
+ exit(1);
+ }
/* For all the crystals found this time ... */
for ( i=0; i<r; i++ ) {