diff --git a/src/pyFAI/ext/CSR_common.pxi b/src/pyFAI/ext/CSR_common.pxi index 5e84f350c..101fc64ca 100644 --- a/src/pyFAI/ext/CSR_common.pxi +++ b/src/pyFAI/ext/CSR_common.pxi @@ -859,8 +859,9 @@ cdef class CsrIntegrator(object): for i in range(start, stop): former_element = element element = work[i] - if ((qmin<=former_element.s0) and (element.s0 <= qmax)) or \ - ((qmin>=former_element.s0) and (element.s0 >= qmax)): #specific case where qmin==qmax + if ((element.s3!=0) and + (((qmin<=former_element.s0) and (element.s0 <= qmax)) or + ((qmin>=former_element.s0) and (element.s0 >= qmax))): #specific case where qmin==qmax acc_sig = acc_sig + element.s1 acc_var = acc_var + element.s2 acc_norm = acc_norm + element.s3