aboutsummaryrefslogtreecommitdiff
path: root/src/get_hkl.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2010-07-17 20:28:16 +0200
committerThomas White <taw@physics.org>2012-02-22 15:26:54 +0100
commit003a1a19a55913633c2e212af840cb4d0390d304 (patch)
tree88f8ddbb0378804395b51806c9dd41803167e6ba /src/get_hkl.c
parent84a7190c4bd7893e1bfdd37522a46fb0d085ed5c (diff)
compare_hkl: Take symmetry into account
Diffstat (limited to 'src/get_hkl.c')
-rw-r--r--src/get_hkl.c65
1 files changed, 6 insertions, 59 deletions
diff --git a/src/get_hkl.c b/src/get_hkl.c
index 1052d786..14f79266 100644
--- a/src/get_hkl.c
+++ b/src/get_hkl.c
@@ -72,42 +72,6 @@ static void noisify_reflections(double *ref)
}
-static void scold_user_about_symmetry(signed int h, signed int k, signed int l,
- signed int he, signed int ke,
- signed int le)
-{
- ERROR("Merohedrally equivalent reflection (%i %i %i) found for "
- "%i %i %i.\n", he, ke, le, h, k, l);
- ERROR("This indicates that you lied to me about the symmetry of the "
- "input reflections. ");
- ERROR("I won't be able to give you a meaningful result in this "
- "situation, so I'm going to give up right now. ");
- ERROR("Please reconsider your previous processing of the data, and "
- "perhaps try again with a lower symmetry for the '-y' option.\n");
-}
-
-
-static int find_unique_equiv(ReflItemList *items, signed int h, signed int k,
- signed int l, const char *mero, signed int *hu,
- signed int *ku, signed int *lu)
-{
- int i;
-
- for ( i=0; i<num_equivs(h, k, l, mero); i++ ) {
-
- signed int he, ke, le;
- get_equiv(h, k, l, &he, &ke, &le, mero, i);
- if ( find_item(items, he, ke, le) ) {
- *hu = he; *ku = ke; *lu = le;
- return 1;
- }
-
- }
-
- return 0;
-}
-
-
static ReflItemList *twin_reflections(double *ref, ReflItemList *items,
const char *holo, const char *mero)
{
@@ -125,28 +89,14 @@ static ReflItemList *twin_reflections(double *ref, ReflItemList *items,
int skip;
it = get_item(items, i);
- h = it->h; k = it->k; l = it->l;
- /* None of the equivalent reflections should exist in the
- * input dataset. That would indicate that the user lied about
- * the input symmetry.
- *
- * Start from j=1 to ignore the reflection itself.
- */
- for ( j=1; j<num_equivs(h, k, l, mero); j++ ) {
-
- signed int he, ke, le;
- get_equiv(h, k, l, &he, &ke, &le, mero, j);
- if ( !find_item(items, he, ke, le) ) continue;
-
- scold_user_about_symmetry(h, k, l, he, ke, le);
- abort();
-
- }
- /* It doesn't matter if the reflection wasn't actually the one
- * we define as being in the asymmetric unit cell, as long as
- * things aren't confused by there being more than one of it.
+ /* There is a many-to-one correspondence between reflections
+ * in the merohedral and holohedral unit cells. Do the
+ * calculation only once for each reflection in the holohedral
+ * cell, which contains fewer reflections.
*/
+ get_asymm(it->h, it->k, it->l, &h, &k, &l, holo);
+ if ( find_item(new, h, k, l) ) continue;
n = num_equivs(h, k, l, holo);
@@ -163,9 +113,6 @@ static ReflItemList *twin_reflections(double *ref, ReflItemList *items,
* We might not have the particular (merohedral)
* equivalent which belongs to our definition of the
* asymmetric unit cell, so check them all.
- *
- * We checked earlier that there's only one of these
- * for each reflection.
*/
if ( !find_unique_equiv(items, he, ke, le, mero,
&hu, &ku, &lu) ) {