From 28f8385969dbdb2f8db9c95d3d431c73319e9f25 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 12 Dec 2013 14:46:21 +0100 Subject: get_hkl: Fix -w even more --- src/get_hkl.c | 63 +++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 35 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/get_hkl.c b/src/get_hkl.c index 0e556a4e..454737b0 100644 --- a/src/get_hkl.c +++ b/src/get_hkl.c @@ -3,11 +3,11 @@ * * Small program to manipulate reflection lists * - * Copyright © 2012 Deutsches Elektronen-Synchrotron DESY, + * Copyright © 2013 Deutsches Elektronen-Synchrotron DESY, * a research centre of the Helmholtz Association. * * Authors: - * 2009-2012 Thomas White + * 2009-2013 Thomas White * * This file is part of CrystFEL. * @@ -173,43 +173,36 @@ static RefList *twin_reflections(RefList *in, int need_all_parts, RefListIterator *iter; RefList *out; SymOpMask *m; - - if ( !is_subgroup(holo, mero) ) { - ERROR("%s is not a subgroup of %s!\n", symmetry_name(mero), - symmetry_name(holo)); - return NULL; - } + int n; out = reflist_new(); + + /* No need to free and reallocate this for every reflection */ m = new_symopmask(holo); for ( refl = first_refl(in, &iter); refl != NULL; - refl = next_refl(refl, iter) ) { - + refl = next_refl(refl, iter) ) + { double total, sigma; - int multi, nbits; + int multi; signed int h, k, l; - int n, j; + int j; int skip; + /* Figure out where to put the twinned version, and check it's + * not there already. */ get_indices(refl, &h, &k, &l); - - /* There is a many-to-one correspondence between reflections - * in the merohedral and holohedral groups. Do the calculation - * only once for each reflection in the holohedral group, which - * contains fewer reflections. - */ get_asymm(holo, h, k, l, &h, &k, &l); if ( find_refl(out, h, k, l) != NULL ) continue; + special_position(holo, m, h, k, l); + n = num_equivs(holo, m); + total = 0.0; sigma = 0.0; multi = 0; skip = 0; - nbits = 0; - special_position(holo, m, h, k, l); - n = num_equivs(holo, m); for ( j=0; j