diff options
author | Thomas White <taw@physics.org> | 2019-08-05 14:06:13 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2019-08-16 10:26:59 +0200 |
commit | b4e52c888c13287eeca1a6b4222e9f3038db8b51 (patch) | |
tree | 478209c620c08becfc0f00a863e0039158cfed74 | |
parent | 14b58086754586c4cf431ee0b54cb4adc7cc4cfd (diff) |
indexamajig: Accept six values for unit cell tolerance
-rw-r--r-- | libcrystfel/src/index.c | 6 | ||||
-rw-r--r-- | src/indexamajig.c | 37 | ||||
-rw-r--r-- | src/process_image.h | 2 |
3 files changed, 31 insertions, 14 deletions
diff --git a/libcrystfel/src/index.c b/libcrystfel/src/index.c index 6f0d1b8c..0f613e45 100644 --- a/libcrystfel/src/index.c +++ b/libcrystfel/src/index.c @@ -67,7 +67,7 @@ struct _indexingprivate { IndexingFlags flags; UnitCell *target_cell; - float tolerance[4]; + double tolerance[6]; struct taketwo_options *ttopts; struct xgandalf_options *xgandalf_opts; @@ -315,7 +315,7 @@ static void *prepare_method(IndexingMethod *m, UnitCell *cell, IndexingPrivate *setup_indexing(const char *method_list, UnitCell *cell, - struct detector *det, float *ltl, + struct detector *det, float *tols, IndexingFlags flags, struct taketwo_options *ttopts, struct xgandalf_options *xgandalf_opts, @@ -439,7 +439,7 @@ IndexingPrivate *setup_indexing(const char *method_list, UnitCell *cell, } else { ipriv->target_cell = NULL; } - for ( i=0; i<4; i++ ) ipriv->tolerance[i] = ltl[i]; + for ( i=0; i<6; i++ ) ipriv->tolerance[i] = tols[i]; ipriv->ttopts = ttopts; ipriv->xgandalf_opts = xgandalf_opts; diff --git a/src/indexamajig.c b/src/indexamajig.c index 739b4969..78f26709 100644 --- a/src/indexamajig.c +++ b/src/indexamajig.c @@ -135,7 +135,7 @@ static void show_help(const char *s) " -p, --pdb=<file> Unit cell file (PDB or CrystFEL unit cell format)\n" " Default: 'molecule.pdb'\n" " --tolerance=<tol> Tolerances for cell comparison\n" -" Default: 5,5,5,1.5\n" +" Default: 5,5,5,1.5,1.5,1.5\n" " --no-check-cell Don't check lattice parameters against input cell\n" " --no-cell-combinations\n" " Don't use axis combinations when checking cell\n" @@ -297,10 +297,12 @@ int main(int argc, char *argv[]) iargs.noisefilter = 0; iargs.median_filter = 0; iargs.satcorr = 1; - iargs.tols[0] = 5.0; - iargs.tols[1] = 5.0; - iargs.tols[2] = 5.0; + iargs.tols[0] = 0.05; + iargs.tols[1] = 0.05; + iargs.tols[2] = 0.05; iargs.tols[3] = 1.5; + iargs.tols[4] = 1.5; + iargs.tols[5] = 1.5; iargs.threshold = 800.0; iargs.min_sq_gradient = 100000.0; iargs.min_snr = 5.0; @@ -1056,14 +1058,29 @@ int main(int argc, char *argv[]) /* Parse unit cell tolerance */ if ( toler != NULL ) { int ttt; - ttt = sscanf(toler, "%f,%f,%f,%f", - &iargs.tols[0], &iargs.tols[1], - &iargs.tols[2], &iargs.tols[3]); - if ( ttt != 4 ) { - ERROR("Invalid parameters for '--tolerance'\n"); - return 1; + ttt = sscanf(toler, "%f,%f,%f,%f,%f,%f", + &iargs.tols[0], &iargs.tols[1], &iargs.tols[2], + &iargs.tols[3], &iargs.tols[4], &iargs.tols[5]); + if ( ttt != 6 ) { + ttt = sscanf(toler, "%f,%f,%f,%f", + &iargs.tols[0], &iargs.tols[1], + &iargs.tols[2], &iargs.tols[3]); + if ( ttt != 4 ) { + ERROR("Invalid parameters for '--tolerance'\n"); + return 1; + } + iargs.tols[4] = iargs.tols[3]; + iargs.tols[5] = iargs.tols[3]; } free(toler); + + /* Percent to fraction */ + iargs.tols[0] /= 100.0; + iargs.tols[1] /= 100.0; + iargs.tols[2] /= 100.0; + iargs.tols[3] = deg2rad(iargs.tols[3]); + iargs.tols[4] = deg2rad(iargs.tols[4]); + iargs.tols[5] = deg2rad(iargs.tols[5]); } /* Parse integration radii */ diff --git a/src/process_image.h b/src/process_image.h index 8d6682a6..f8b0f4b1 100644 --- a/src/process_image.h +++ b/src/process_image.h @@ -74,7 +74,7 @@ struct index_args struct detector *det; IndexingPrivate *ipriv; int peaks; /* Peak detection method */ - float tols[4]; + float tols[6]; struct beam_params *beam; char *hdf5_peak_path; int half_pixel_shift; |