diff options
author | Valerio Mariani <valerio.mariani@desy.de> | 2017-03-13 11:17:57 +0100 |
---|---|---|
committer | Valerio Mariani <valerio.mariani@desy.de> | 2017-03-13 11:17:57 +0100 |
commit | b2de09452e8edf050a8679e726f5075abd37e961 (patch) | |
tree | ef23b5f8b6e7929f6ce4c8586cb4b458d185f245 /libcrystfel | |
parent | 173fe22faba8c101e723b5c865fa0c5dd822ce78 (diff) |
Added saturated peak management to peakfinder8
Diffstat (limited to 'libcrystfel')
-rw-r--r-- | libcrystfel/src/peakfinder8.c | 10 | ||||
-rw-r--r-- | libcrystfel/src/peakfinder8.h | 2 | ||||
-rw-r--r-- | libcrystfel/src/peaks.c | 4 | ||||
-rw-r--r-- | libcrystfel/src/peaks.h | 2 |
4 files changed, 13 insertions, 5 deletions
diff --git a/libcrystfel/src/peakfinder8.c b/libcrystfel/src/peakfinder8.c index fecc61da..82a7e316 100644 --- a/libcrystfel/src/peakfinder8.c +++ b/libcrystfel/src/peakfinder8.c @@ -919,7 +919,7 @@ int peakfinder8(struct image *img, int max_n_peaks, float threshold, float min_snr, int min_pix_count, int max_pix_count, int local_bg_radius, int min_res, - int max_res) + int max_res, int use_saturated) { struct radius_maps *rmaps; struct peakfinder_mask *pfmask; @@ -1042,6 +1042,14 @@ int peakfinder8(struct image *img, int max_n_peaks, p = &img->det->panels[pi]; + img->num_peaks += 1; + if ( pkdata->max_i[pki] > p->max_adu ) { + img->num_saturated_peaks++; + if ( !use_saturated ) { + continue; + } + } + image_add_feature(img->features, pkdata->com_fs[pki], pkdata->com_ss[pki], diff --git a/libcrystfel/src/peakfinder8.h b/libcrystfel/src/peakfinder8.h index 34cf5d62..1103ef96 100644 --- a/libcrystfel/src/peakfinder8.h +++ b/libcrystfel/src/peakfinder8.h @@ -37,6 +37,6 @@ int peakfinder8(struct image *img, int max_n_peaks, float threshold, float min_snr, int mix_pix_count, int max_pix_count, int local_bg_radius, int min_res, - int max_res); + int max_res, int use_saturated); #endif // PEAKFINDER8_H diff --git a/libcrystfel/src/peaks.c b/libcrystfel/src/peaks.c index ea2fe3e3..28c79538 100644 --- a/libcrystfel/src/peaks.c +++ b/libcrystfel/src/peaks.c @@ -547,7 +547,7 @@ int search_peaks_peakfinder8(struct image *image, int max_n_peaks, float threshold, float min_snr, int min_pix_count, int max_pix_count, int local_bg_radius, int min_res, - int max_res) + int max_res, int use_saturated) { if ( image->features != NULL ) { image_feature_list_free(image->features); @@ -559,7 +559,7 @@ int search_peaks_peakfinder8(struct image *image, int max_n_peaks, return peakfinder8(image, max_n_peaks, threshold, min_snr, min_pix_count, max_pix_count, local_bg_radius, min_res, - max_res); + max_res, use_saturated); } diff --git a/libcrystfel/src/peaks.h b/libcrystfel/src/peaks.h index dfc286cf..a5095127 100644 --- a/libcrystfel/src/peaks.h +++ b/libcrystfel/src/peaks.h @@ -53,7 +53,7 @@ extern int search_peaks_peakfinder8(struct image *image, int max_n_peaks, float threshold, float min_snr, int mix_pix_count, int max_pix_count, int local_bg_radius, int min_res, - int max_res); + int max_res, int use_saturated); extern int peak_sanity_check(struct image *image, Crystal **crystals, int n_cryst); |