aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src
diff options
context:
space:
mode:
authorLorenzo Galli <gallil@cfelsgi.desy.de>2012-02-20 14:57:02 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:45 +0100
commitf017522931d7704dde09416473dfcfa5de629f4d (patch)
tree0e8ad4f6cf5e63086dcec41b4ed252d90b6d03c2 /libcrystfel/src
parent30b0fffa60b00b48fc42bc75a9f8dcce8db7a4fc (diff)
Added "--tolerance" option in indexamajig
Diffstat (limited to 'libcrystfel/src')
-rw-r--r--libcrystfel/src/cell.c7
-rw-r--r--libcrystfel/src/cell.h2
-rw-r--r--libcrystfel/src/index.c6
-rw-r--r--libcrystfel/src/index.h2
4 files changed, 8 insertions, 9 deletions
diff --git a/libcrystfel/src/cell.c b/libcrystfel/src/cell.c
index c31697bc..a6df931b 100644
--- a/libcrystfel/src/cell.c
+++ b/libcrystfel/src/cell.c
@@ -669,7 +669,7 @@ static int same_vector(struct cvec a, struct cvec b)
/* Attempt to make 'cell' fit into 'template' somehow */
UnitCell *match_cell(UnitCell *cell, UnitCell *template, int verbose,
- int reduce)
+ float *tols, int reduce)
{
signed int n1l, n2l, n3l;
double asx, asy, asz;
@@ -683,8 +683,7 @@ UnitCell *match_cell(UnitCell *cell, UnitCell *template, int verbose,
float best_fom = +999999999.9; /* Large number.. */
int ncand[3] = {0,0,0};
signed int ilow, ihigh;
- float ltl = 5.0; /* percent */
- float angtol = deg2rad(1.5);
+ float angtol = deg2rad(tols[3]);
if ( cell_get_reciprocal(template, &asx, &asy, &asz,
&bsx, &bsy, &bsz,
@@ -753,7 +752,7 @@ UnitCell *match_cell(UnitCell *cell, UnitCell *template, int verbose,
/* Test modulus for agreement with moduli of template */
for ( i=0; i<3; i++ ) {
- if ( !within_tolerance(lengths[i], tlen, ltl) )
+ if ( !within_tolerance(lengths[i], tlen, tols[i]) )
continue;
cand[i][ncand[i]].vec.u = tx;
diff --git a/libcrystfel/src/cell.h b/libcrystfel/src/cell.h
index 72c0b6df..e69ce721 100644
--- a/libcrystfel/src/cell.h
+++ b/libcrystfel/src/cell.h
@@ -96,7 +96,7 @@ extern UnitCell *rotate_cell(UnitCell *in, double omega, double phi,
extern void cell_print(UnitCell *cell);
extern UnitCell *match_cell(UnitCell *cell, UnitCell *tempcell, int verbose,
- int reduce);
+ float *ltl, int reduce);
extern UnitCell *match_cell_ab(UnitCell *cell, UnitCell *tempcell);
diff --git a/libcrystfel/src/index.c b/libcrystfel/src/index.c
index 34a5dda3..56b34baa 100644
--- a/libcrystfel/src/index.c
+++ b/libcrystfel/src/index.c
@@ -139,7 +139,7 @@ void map_all_peaks(struct image *image)
void index_pattern(struct image *image, UnitCell *cell, IndexingMethod *indm,
int cellr, int verbose, IndexingPrivate **ipriv,
- int config_insane)
+ int config_insane, float *ltl)
{
int i;
int n = 0;
@@ -191,10 +191,10 @@ void index_pattern(struct image *image, UnitCell *cell, IndexingMethod *indm,
new_cell = cell_new_from_cell(cand);
break;
case CELLR_REDUCE :
- new_cell = match_cell(cand, cell, verbose, 1);
+ new_cell = match_cell(cand, cell, verbose, ltl, 1);
break;
case CELLR_COMPARE :
- new_cell = match_cell(cand, cell, verbose, 0);
+ new_cell = match_cell(cand, cell, verbose, ltl, 0);
break;
case CELLR_COMPARE_AB :
new_cell = match_cell_ab(cand, cell);
diff --git a/libcrystfel/src/index.h b/libcrystfel/src/index.h
index 9d4b69bd..1457e93f 100644
--- a/libcrystfel/src/index.h
+++ b/libcrystfel/src/index.h
@@ -54,7 +54,7 @@ extern void map_all_peaks(struct image *image);
extern void index_pattern(struct image *image, UnitCell *cell,
IndexingMethod *indm, int cellr, int verbose,
- IndexingPrivate **priv, int config_insane);
+ IndexingPrivate **priv, int config_insane, float *ltl);
extern void cleanup_indexing(IndexingPrivate **priv);