aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/predict-refine.c
diff options
context:
space:
mode:
Diffstat (limited to 'libcrystfel/src/predict-refine.c')
-rw-r--r--libcrystfel/src/predict-refine.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libcrystfel/src/predict-refine.c b/libcrystfel/src/predict-refine.c
index fbadcc67..19c689cd 100644
--- a/libcrystfel/src/predict-refine.c
+++ b/libcrystfel/src/predict-refine.c
@@ -612,7 +612,11 @@ int refine_prediction(struct image *image, Crystal *cr)
return 1;
}
for ( i=0; i<n; i++ ) {
- rps[i].Ih = rps[i].peak->intensity / max_I;
+ if ( rps[i].peak->intensity > 0.0 ) {
+ rps[i].Ih = rps[i].peak->intensity / max_I;
+ } else {
+ rps[i].Ih = 0.0;
+ }
}
//STATUS("Initial residual = %e\n",