From 15a538e5a0b66b590a8857b27e8e79d11d6174d9 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 29 Nov 2013 15:57:22 +0100 Subject: RefList: Increase maximum index to 511 --- libcrystfel/src/geometry.c | 11 ++++++----- libcrystfel/src/reflist.c | 22 +++++++++++----------- 2 files changed, 17 insertions(+), 16 deletions(-) (limited to 'libcrystfel') diff --git a/libcrystfel/src/geometry.c b/libcrystfel/src/geometry.c index 9ca6262c..e9712b0a 100644 --- a/libcrystfel/src/geometry.c +++ b/libcrystfel/src/geometry.c @@ -264,12 +264,13 @@ RefList *find_intersections(struct image *image, Crystal *cryst) kmax = mres * modulus(bx, by, bz); lmax = mres * modulus(cx, cy, cz); - if ( (hmax >= 256) || (kmax >= 256) || (lmax >= 256) ) { - ERROR("Unit cell is stupidly large.\n"); + if ( (hmax >= 512) || (kmax >= 512) || (lmax >= 512) ) { + ERROR("Unit cell is too large - will only integrate reflections" + " up to 511th order.\n"); cell_print(cell); - if ( hmax >= 256 ) hmax = 255; - if ( kmax >= 256 ) kmax = 255; - if ( lmax >= 256 ) lmax = 255; + if ( hmax >= 512 ) hmax = 511; + if ( kmax >= 512 ) kmax = 511; + if ( lmax >= 512 ) lmax = 511; } cell_get_reciprocal(cell, &asx, &asy, &asz, diff --git a/libcrystfel/src/reflist.c b/libcrystfel/src/reflist.c index a450d8fa..f6fad33d 100644 --- a/libcrystfel/src/reflist.c +++ b/libcrystfel/src/reflist.c @@ -135,10 +135,10 @@ struct _reflist { }; -#define SERIAL(h, k, l) ((((h)+256)<<18) + (((k)+256)<<9) + ((l)+256)) -#define GET_H(serial) ((((serial) & 0xfffc0000)>>18)-256) -#define GET_K(serial) ((((serial) & 0x0003fe00)>>9)-256) -#define GET_L(serial) (((serial) & 0x000001ff)-256) +#define SERIAL(h, k, l) ((((h)+512)<<20) + (((k)+512)<<10) + ((l)+512)) +#define GET_H(serial) ((((serial) & 0x3ff00000)>>20)-512) +#define GET_K(serial) ((((serial) & 0x000ffc00)>>10)-512) +#define GET_L(serial) (((serial) & 0x000003ff)-512) /**************************** Creation / deletion *****************************/ @@ -261,13 +261,13 @@ Reflection *find_refl(const RefList *list, if ( list->head == NULL ) return NULL; - /* Indices greater than or equal to 256 are filtered out when + /* Indices greater than or equal to 512 are filtered out when * reflections are added, so don't even bother looking. * (also, looking for such reflections causes trouble because the search * serial number would be invalid) */ - if ( abs(h) >= 256 ) return NULL; - if ( abs(k) >= 256 ) return NULL; - if ( abs(l) >= 256 ) return NULL; + if ( abs(h) >= 512 ) return NULL; + if ( abs(k) >= 512 ) return NULL; + if ( abs(l) >= 512 ) return NULL; refl = list->head; @@ -883,9 +883,9 @@ Reflection *add_refl(RefList *list, signed int h, signed int k, signed int l) { Reflection *new; - assert(abs(h)<256); - assert(abs(k)<256); - assert(abs(l)<256); + assert(abs(h)<512); + assert(abs(k)<512); + assert(abs(l)<512); new = new_node(SERIAL(h, k, l)); if ( new == NULL ) return NULL; -- cgit v1.2.3