aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-10-26 15:06:38 +0100
committerThomas White <taw@physics.org>2020-10-26 15:08:50 +0100
commit2089e6e3c0a34430239dce596bc27db30611ac2f (patch)
tree0b269fba30065b28c51ca3456313d26347fc58e5 /libcrystfel
parent6819e268a8401fec0001812e7612909b3211fab1 (diff)
Label all uses of cell tolerances
I'm sick of fixing this same issue over and over again. New rule: any code handling unit cell tolerances MUST be labelled with details of units.
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/cell-utils.c3
-rw-r--r--libcrystfel/src/index.c2
2 files changed, 5 insertions, 0 deletions
diff --git a/libcrystfel/src/cell-utils.c b/libcrystfel/src/cell-utils.c
index 2e2e431a..22610ce1 100644
--- a/libcrystfel/src/cell-utils.c
+++ b/libcrystfel/src/cell-utils.c
@@ -1354,6 +1354,7 @@ int compare_cell_parameters(UnitCell *cell, UnitCell *reference,
cell_get_parameters(cell, &a1, &b1, &c1, &al1, &be1, &ga1);
cell_get_parameters(reference, &a2, &b2, &c2, &al2, &be2, &ga2);
+ /* within_tolerance() takes a percentage */
if ( !within_tolerance(a1, a2, tols[0]*100.0) ) return 0;
if ( !within_tolerance(b1, b2, tols[1]*100.0) ) return 0;
if ( !within_tolerance(c1, c2, tols[2]*100.0) ) return 0;
@@ -1399,6 +1400,7 @@ static double moduli_check(double ax, double ay, double az,
* \returns non-zero if the cells match.
*
*/
+/* 'tols' is in frac (not %) and radians */
int compare_cell_parameters_and_orientation(UnitCell *cell, UnitCell *reference,
const double *tols)
{
@@ -1454,6 +1456,7 @@ int compare_cell_parameters_and_orientation(UnitCell *cell, UnitCell *reference,
* \returns non-zero if the cells match.
*
*/
+/* 'tols' is in frac (not %) and radians */
int compare_permuted_cell_parameters_and_orientation(UnitCell *cell,
UnitCell *reference,
const double *tols,
diff --git a/libcrystfel/src/index.c b/libcrystfel/src/index.c
index f9c02c28..457fd7fe 100644
--- a/libcrystfel/src/index.c
+++ b/libcrystfel/src/index.c
@@ -354,6 +354,7 @@ IndexingMethod *parse_indexing_methods(const char *method_list,
}
+/* 'tols' is in frac (not %) and radians */
IndexingPrivate *setup_indexing(const char *method_list, UnitCell *cell,
const DataTemplate *dtempl,
float *tols, IndexingFlags flags,
@@ -776,6 +777,7 @@ static int try_indexer(struct image *image, IndexingMethod indm,
for ( j=0; j<this_crystal; j++ ) {
Crystal *that_cr = image->crystals[j];
+ /* 'tols' is in frac (not %) and radians */
const double tols[] = {0.1, 0.1, 0.1,
deg2rad(5.0),
deg2rad(5.0),