From b4e52c888c13287eeca1a6b4222e9f3038db8b51 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 5 Aug 2019 14:06:13 +0200 Subject: indexamajig: Accept six values for unit cell tolerance --- src/indexamajig.c | 37 +++++++++++++++++++++++++++---------- src/process_image.h | 2 +- 2 files changed, 28 insertions(+), 11 deletions(-) (limited to 'src') 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= Unit cell file (PDB or CrystFEL unit cell format)\n" " Default: 'molecule.pdb'\n" " --tolerance= 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; -- cgit v1.2.3