aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2013-02-08 21:31:04 -0800
committerThomas White <taw@physics.org>2013-02-08 21:31:04 -0800
commit3de4d63ee345b01a9f992f60e1fb818b0c707c9c (patch)
tree956641ded2a2de490e5ab3eeca12d769d09184ae /libcrystfel/src
parent800a1cbe01bfb370ee2707317e57082e4c8b484d (diff)
Saturation counting fixes
Diffstat (limited to 'libcrystfel/src')
-rw-r--r--libcrystfel/src/peaks.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/libcrystfel/src/peaks.c b/libcrystfel/src/peaks.c
index cfd00d58..31eea0cb 100644
--- a/libcrystfel/src/peaks.c
+++ b/libcrystfel/src/peaks.c
@@ -415,7 +415,6 @@ static void search_peaks_in_panel(struct image *image, float threshold,
int nrej_fra = 0;
int nrej_fail = 0;
int nrej_snr = 0;
- int nrej_sat = 0;
int nacc = 0;
int ncull;
@@ -920,12 +919,17 @@ void validate_peaks(struct image *image, double min_snr,
r = integrate_peak(image, f->fs, f->ss,
&f_fs, &f_ss, &intensity, &sigma,
- ir_inn, ir_mid, ir_out, 0, NULL, &saturated);
+ ir_inn, ir_mid, ir_out, 1, NULL, &saturated);
if ( r ) {
n_int++;
continue;
}
+ if ( saturated ) {
+ n_sat++;
+ if ( !use_saturated ) continue;
+ }
+
/* It is possible for the centroid to fall outside the image */
if ( (f_fs < p->min_fs) || (f_fs > p->max_fs)
|| (f_ss < p->min_ss) || (f_ss > p->max_ss) )
@@ -946,11 +950,6 @@ void validate_peaks(struct image *image, double min_snr,
continue;
}
- if ( saturated && !use_saturated ) {
- n_sat++;
- continue;
- }
-
/* Add using "better" coordinates */
image_add_feature(flist, f_fs, f_ss, image, intensity, NULL);
@@ -962,4 +961,6 @@ void validate_peaks(struct image *image, double min_snr,
// n_wtf, n_int, n_dft, n_snr, n_prx, n_sat);
image_feature_list_free(image->features);
image->features = flist;
+ image->num_saturated_peaks = n_sat;
+ image->num_peaks = image_feature_count(flist);
}