From 2089e6e3c0a34430239dce596bc27db30611ac2f Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 26 Oct 2020 15:06:38 +0100 Subject: 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. --- src/indexamajig.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/indexamajig.c') diff --git a/src/indexamajig.c b/src/indexamajig.c index 8285f780..2f96ecac 100644 --- a/src/indexamajig.c +++ b/src/indexamajig.c @@ -382,6 +382,8 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state) break; case 401 : + /* Values in 'tols' are in frac (not %) and rad + * Conversion happens a few lines below */ r = sscanf(arg, "%f,%f,%f,%f,%f,%f", &args->iargs.tols[0], &args->iargs.tols[1], &args->iargs.tols[2], &args->iargs.tols[3], &args->iargs.tols[4], &args->iargs.tols[5]); @@ -620,12 +622,12 @@ int main(int argc, char *argv[]) args.iargs.cell = NULL; args.iargs.noisefilter = 0; args.iargs.median_filter = 0; - args.iargs.tols[0] = 0.05; - args.iargs.tols[1] = 0.05; - args.iargs.tols[2] = 0.05; - args.iargs.tols[3] = deg2rad(1.5); - args.iargs.tols[4] = deg2rad(1.5); - args.iargs.tols[5] = deg2rad(1.5); + args.iargs.tols[0] = 0.05; /* frac (not %) */ + args.iargs.tols[1] = 0.05; /* frac (not %) */ + args.iargs.tols[2] = 0.05; /* frac (not %) */ + args.iargs.tols[3] = deg2rad(1.5); /* radians */ + args.iargs.tols[4] = deg2rad(1.5); /* radians */ + args.iargs.tols[5] = deg2rad(1.5); /* radians */ args.iargs.threshold = 800.0; args.iargs.min_sq_gradient = 100000.0; args.iargs.min_snr = 5.0; -- cgit v1.2.3