diff options
author | Thomas White <taw@physics.org> | 2012-12-03 17:03:55 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-12-03 17:12:37 +0100 |
commit | 44a5179f3e353627061f58c1cad717d383254843 (patch) | |
tree | 2ef46c30ae85c9fbae8b17716338f40fb15da700 | |
parent | f5585ca39abd97507cf4c53138268e7efef5172d (diff) |
Treat SNR=nan (=0/0) as below any SNR threshold
-rw-r--r-- | libcrystfel/src/peaks.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libcrystfel/src/peaks.c b/libcrystfel/src/peaks.c index 236c0c52..2258ec03 100644 --- a/libcrystfel/src/peaks.c +++ b/libcrystfel/src/peaks.c @@ -813,8 +813,14 @@ void integrate_reflections(struct image *image, int use_closer, int bgsub, if ( !integrate_saturated ) r = 1; } - /* I/sigma(I) cutoff */ - if ( intensity/sigma < min_snr ) r = 1; + /* I/sigma(I) cutoff + * Rejects reflections below --min-integration-snr, or if the + * SNR is clearly silly. Silly indicates that the intensity + * was zero. */ + snr = fabs(intensity)/sigma; + if ( isnan(snr) || (snr < min_snr) ) { + r = 1; + } /* Record intensity and set redundancy to 1 on success */ if ( r == 0 ) { @@ -825,7 +831,6 @@ void integrate_reflections(struct image *image, int use_closer, int bgsub, set_redundancy(refl, 0); } - snr = intensity / sigma; if ( snr > 1.0 ) { if ( first ) { av = snr; |