aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/peaks.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2016-10-13 17:03:05 +0200
committerThomas White <taw@physics.org>2016-10-14 17:28:44 +0200
commitcc55abcff6e91d57e8226fa8a4265b667c20ceb0 (patch)
tree574d8920dfaaf6b5f966c541547e7d27066e91ab /libcrystfel/src/peaks.c
parent6ff1adfc306b36c452799a3c5957b7b2b4846fd5 (diff)
validate_peaks(): Remove drifting and proximity checks, and use original coordinates
We trust the HDF5 peaks, even if we can't see a peak there. That means we can't reliably take a centroid and "improve" the coordinates. In some cases, the centroiding procedure seems to be making the peak coordinates worse than they were originally. Now, the only remaining checks are: 1. Is the peak in a bad region of the detector? 2. Is it saturated? (but --use-saturated is the default) 3. If --check-hdf5-snr, is it above the minimum SNR?
Diffstat (limited to 'libcrystfel/src/peaks.c')
-rw-r--r--libcrystfel/src/peaks.c30
1 files changed, 6 insertions, 24 deletions
diff --git a/libcrystfel/src/peaks.c b/libcrystfel/src/peaks.c
index 7fc30ef7..cb2a9f5a 100644
--- a/libcrystfel/src/peaks.c
+++ b/libcrystfel/src/peaks.c
@@ -609,7 +609,7 @@ void validate_peaks(struct image *image, double min_snr,
{
int i, n;
ImageFeatureList *flist;
- int n_wtf, n_int, n_dft, n_snr, n_prx, n_sat;
+ int n_wtf, n_int, n_snr, n_sat;
flist = image_feature_list_new();
if ( flist == NULL ) return;
@@ -617,13 +617,11 @@ void validate_peaks(struct image *image, double min_snr,
n = image_feature_count(image->features);
/* Loop over peaks, putting each one through the integrator */
- n_wtf = 0; n_int = 0; n_dft = 0; n_snr = 0; n_prx = 0; n_sat = 0;
+ n_wtf = 0; n_int = 0; n_snr = 0; n_sat = 0;
for ( i=0; i<n; i++ ) {
struct imagefeature *f;
int r;
- double d;
- int idx;
double f_fs, f_ss;
double intensity, sigma;
int saturated;
@@ -649,36 +647,20 @@ void validate_peaks(struct image *image, double min_snr,
}
}
- /* It is possible for the centroid to fall outside the image */
- if ( (f_fs < 0) || (f_fs > f->p->w)
- || (f_ss < 0) || (f_ss > f->p->h) )
- {
- n_dft++;
- continue;
- }
-
if ( check_snr && (fabs(intensity)/sigma < min_snr) ) {
n_snr++;
continue;
}
- /* Check for a nearby feature */
- image_feature_closest(flist, f_fs, f_ss, f->p, &d, &idx);
- if ( d < 2.0*ir_inn ) {
- n_prx++;
- continue;
- }
-
/* Add using "better" coordinates */
- image_add_feature(flist, f_fs, f_ss, f->p, image, intensity,
+ image_add_feature(flist, f->fs, f->ss, f->p, image, intensity,
NULL);
}
- //STATUS("HDF5: %i peaks, validated: %i. WTF: %i, integration: %i,"
- // " drifted: %i, SNR: %i, proximity: %i, saturated: %i\n",
- // n, image_feature_count(flist),
- // n_wtf, n_int, n_dft, n_snr, n_prx, n_sat);
+ //STATUS("HDF5: %i peaks, validated: %i. WTF: %i, integration: %i, "
+ // "SNR: %i, saturated: %i\n",
+ // n, image_feature_count(flist), n_wtf, n_int, n_snr, n_sat);
image_feature_list_free(image->features);
image->features = flist;
image->num_saturated_peaks = n_sat;