diff options
-rw-r--r-- | src/check_hkl.c | 2 | ||||
-rw-r--r-- | src/process_hkl.c | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/check_hkl.c b/src/check_hkl.c index 650895ec..bf2a0ba1 100644 --- a/src/check_hkl.c +++ b/src/check_hkl.c @@ -243,6 +243,8 @@ static void plot_shells(const double *ref, ReflItemList *items, UnitCell *cell, continue; } + if ( !isfinite(val/esd) ) continue; + /* measured[bin] was done earlier */ measurements[bin] += lookup_count(counts, h, k, l); snr[bin] += val / esd; diff --git a/src/process_hkl.c b/src/process_hkl.c index b1fcad51..162b0bd6 100644 --- a/src/process_hkl.c +++ b/src/process_hkl.c @@ -813,9 +813,12 @@ int main(int argc, char *argv[]) dev = lookup_intensity(devs, h, k, l); count = lookup_count(counts, h, k, l); - if ( count < 2 ) continue; - - esd = sqrt(dev) / (double)count; + if ( count < 2 ) { + /* If we have only one measurement, the error is 100% */ + esd = lookup_intensity(model, h, k, l); + } else { + esd = sqrt(dev) / (double)count; + } set_intensity(esds, h, k, l, esd); } |