aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2017-03-08 15:27:07 +0100
committerThomas White <taw@physics.org>2017-03-08 16:52:49 +0100
commit10c3e04dda4264add6e99cb4763c9dbb31c771c9 (patch)
tree14849573474f701f3d309205286a264579fe7139
parent6cbd80653d2c2ddd93ffb3228521b9f801e48a70 (diff)
compare_hkl: Fix combination of sigma(I) values for d1sig and d2sig
-rw-r--r--doc/man/compare_hkl.12
-rw-r--r--src/compare_hkl.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/doc/man/compare_hkl.1 b/doc/man/compare_hkl.1
index a52ddaef..30fcd93e 100644
--- a/doc/man/compare_hkl.1
+++ b/doc/man/compare_hkl.1
@@ -72,7 +72,7 @@ Note that this figure of merit compares measurements within one data set, so it
The ratio of Rano to Rsplit, as defined above.
.IP "\fBd1sig\fR and \fBd2sig\fR"
.PD
-The fraction of differences between intensities which are within one times (for \fBd1sig\fR) and two times (for \fBd2sig\fR) the mean of the corresponding sigma(I) values.
+The fraction of differences between intensities which are within one times (for \fBd1sig\fR) and two times (for \fBd2sig\fR) the combination of the corresponding sigma(I) values.
.PP
I1 and I2 are the intensities of the same reflection in both reflection lists. The two sets of reflections will be put on a common scale (linear and Debye-Waller terms) unless you use \fB-u\fR.
.RE
diff --git a/src/compare_hkl.c b/src/compare_hkl.c
index 51e51dc9..5ce003fa 100644
--- a/src/compare_hkl.c
+++ b/src/compare_hkl.c
@@ -286,13 +286,13 @@ static void add_to_fom(struct fom_context *fctx, double i1, double i2,
break;
case FOM_D1SIG :
- if ( fabs(i1-i2) < (sig1+sig2)/2.0 ) {
+ if ( fabs(i1-i2) < sqrt(sig1*sig1 + sig2*sig2) ) {
fctx->n_within[bin]++;
}
break;
case FOM_D2SIG :
- if ( fabs(i1-i2) < sig1+sig2 ) { /* = 2 * (sig1+sig2)/2 */
+ if ( fabs(i1-i2) < 2.0*sqrt(sig1*sig1 + sig2*sig2) ) {
fctx->n_within[bin]++;
}
break;