Commit e2ff3965 authored by Thomas White's avatar Thomas White
Browse files

Fix stability of SNRs

parent 2f942f0a
......@@ -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;
......
......@@ -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);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment