From 56f69289cb08deeade5811167deeff451ef5026f Mon Sep 17 00:00:00 2001 From: Jerome Kieffer Date: Sat, 7 Dec 2024 21:42:22 +0100 Subject: [PATCH] Discard pixel without weight --- src/pyFAI/ext/CSR_common.pxi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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