diff options
author | Keitaro Yamashita <keitaro.yamashita@riken.jp> | 2018-06-07 19:32:02 +0900 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2018-06-12 11:08:23 +0200 |
commit | 20ab32852e6e2a07f3bf554f49f1c41d5b7112b8 (patch) | |
tree | 78115c6d615805e0cd70174a73522f619a9cbcc2 /libcrystfel/src/peakfinder8.c | |
parent | 1d2e4eaba76977e5a169eb5466e5690b56320cb9 (diff) |
peakfinder8: do not subtract constant value to avoid negative weights.
Diffstat (limited to 'libcrystfel/src/peakfinder8.c')
-rw-r--r-- | libcrystfel/src/peakfinder8.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libcrystfel/src/peakfinder8.c b/libcrystfel/src/peakfinder8.c index f96750de..891a0878 100644 --- a/libcrystfel/src/peakfinder8.c +++ b/libcrystfel/src/peakfinder8.c @@ -873,8 +873,8 @@ static void process_panel(int asic_size_fs, int asic_size_ss, int num_pix_fs, // Remember that curr_idx = curr_fs + curr_ss*num_pix_fs curr_fs = curr_idx % num_pix_fs; curr_ss = curr_idx / num_pix_fs; - sum_com_fs += curr_i * ((float)curr_fs); - sum_com_ss += curr_i * ((float)curr_ss); + sum_com_fs += curr_i_raw * ((float)curr_fs); + sum_com_ss += curr_i_raw * ((float)curr_ss); if ( curr_i_raw > pk_max_i_raw ) pk_max_i_raw = curr_i_raw; if ( curr_i > peak_max_i ) peak_max_i = curr_i; @@ -882,10 +882,10 @@ static void process_panel(int asic_size_fs, int asic_size_ss, int num_pix_fs, // This CAN happen! Better to skip... - if ( fabs(peak_tot_i) < 1e-10 ) continue; + if ( fabs(pk_tot_i_raw) < 1e-10 ) continue; - peak_com_fs = sum_com_fs / fabs(peak_tot_i); - peak_com_ss = sum_com_ss / fabs(peak_tot_i); + peak_com_fs = sum_com_fs / fabs(pk_tot_i_raw); + peak_com_ss = sum_com_ss / fabs(pk_tot_i_raw); // Calculate signal-to-noise and apply SNR criteria if ( fabs(local_sigma) > 1e-10 ) { |