aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libcrystfel/src/geometry.c11
-rw-r--r--libcrystfel/src/reflist.c22
-rw-r--r--tests/list_check.c2
3 files changed, 18 insertions, 17 deletions
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;
diff --git a/tests/list_check.c b/tests/list_check.c
index 9656dd1a..a83de455 100644
--- a/tests/list_check.c
+++ b/tests/list_check.c
@@ -45,7 +45,7 @@ struct refltemp {
int found;
};
-#define RANDOM_INDEX (128*random()/RAND_MAX - 256*random()/RAND_MAX)
+#define RANDOM_INDEX (1022*random()/RAND_MAX - 511)
static int test_lists(int num_items)