aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/diffraction.cl2
-rw-r--r--src/diffraction.c5
2 files changed, 5 insertions, 2 deletions
diff --git a/data/diffraction.cl b/data/diffraction.cl
index fe0604d8..7ccfa813 100644
--- a/data/diffraction.cl
+++ b/data/diffraction.cl
@@ -117,7 +117,7 @@ float get_intensity(global float *intensities, float16 cell, float4 q)
/* Return a silly value if indices are out of range */
if ( (abs(h) > INDMAX) || (abs(k) > INDMAX) || (abs(l) > INDMAX) ) {
- return 1000000.0;
+ return 0.0;
}
h = (h>=0) ? h : h+IDIM;
diff --git a/src/diffraction.c b/src/diffraction.c
index 29e30431..93ac7f8e 100644
--- a/src/diffraction.c
+++ b/src/diffraction.c
@@ -229,7 +229,10 @@ static double molecule_factor(const double *intensities,const double *phases,
h = (signed int)rint(hd);
k = (signed int)rint(kd);
l = (signed int)rint(ld);
- r = lookup_intensity(intensities, h, k, l);
+ if ( abs(h) > INDMAX ) r = 0.0;
+ else if ( abs(k) > INDMAX ) r = 0.0;
+ else if ( abs(l) > INDMAX ) r = 0.0;
+ else r = lookup_intensity(intensities, h, k, l);
break;
case GRADIENT_INTERPOLATE :
r = interpolate_intensity(intensities, hd, kd, ld);