diff options
author | Thomas White <taw@physics.org> | 2018-12-18 11:09:32 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2018-12-18 15:38:13 +0100 |
commit | 9b9bc02ddc7a040b6367844498b5be87437d1ced (patch) | |
tree | 277322eb283dab4931977f03b9d7b498ac78433f | |
parent | 80f8f5927de74b87115fd7bab01c9d578f1685ca (diff) |
check_hkl: Catch NaN L-value due to two zeroed negative intensities
-rw-r--r-- | src/check_hkl.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/check_hkl.c b/src/check_hkl.c index 018200cf..ba577d45 100644 --- a/src/check_hkl.c +++ b/src/check_hkl.c @@ -95,6 +95,11 @@ static int add_ltest(RefList *list, double i1, int *bins, int nbins, i2 = get_intensity(refl); L = (i1-i2) / (i1+i2); + if ( isnan(L) ) { + /* This happens with --zero-negs and two negative intensities, + * because L=(0-0)/(0+0) */ + return 0; + } bin = fabs(L)/step; if ( (bin < 0) || (isnan(L)) ) { |