aboutsummaryrefslogtreecommitdiff
path: root/src/compare_hkl.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-09-20 14:06:47 +0200
committerThomas White <taw@physics.org>2012-02-22 15:27:37 +0100
commit1e6a810ad46056154dd8984773d15828838658b5 (patch)
treec1ea3126e973720c5d3ce7702a46c882cefb2a3f /src/compare_hkl.c
parentfba222a2c0d377f1b87644ffb3eeb9c40252bc89 (diff)
compare_hkl: Calculate Rsplit in shells, and say what it is
Diffstat (limited to 'src/compare_hkl.c')
-rw-r--r--src/compare_hkl.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/compare_hkl.c b/src/compare_hkl.c
index 3d088b92..c61df8c4 100644
--- a/src/compare_hkl.c
+++ b/src/compare_hkl.c
@@ -83,12 +83,6 @@ static void plot_shells(RefList *list1, double *arr2, double scale,
return;
}
- fh = fopen("shells.dat", "w");
- if ( fh == NULL ) {
- ERROR("Couldn't open 'shells.dat'\n");
- return;
- }
-
for ( i=0; i<NBINS; i++ ) {
num[i] = 0.0;
cts[i] = 0;
@@ -228,7 +222,7 @@ static void plot_shells(RefList *list1, double *arr2, double scale,
i2 = scale * lookup_intensity(arr2, h, k, l);
num[bin] += fabs(i1 - i2);
- den += i1;
+ den += i1 + i2;
ctot++;
cts[bin]++;
@@ -239,12 +233,20 @@ static void plot_shells(RefList *list1, double *arr2, double scale,
nout);
}
+ fh = fopen("shells.dat", "w");
+ if ( fh == NULL ) {
+ ERROR("Couldn't open 'shells.dat'\n");
+ return;
+ }
+
+ fprintf(fh, "1/d centre Rsplit / %%\n");
+
for ( i=0; i<NBINS; i++ ) {
double r, cen;
cen = rmins[i] + (rmaxs[i] - rmins[i])/2.0;
- r = (num[i]/den)*((double)ctot/cts[i]);
- fprintf(fh, "%f %f\n", cen*1.0e-9, r*100.0);
+ r = (2.0*(num[i]/den)*((double)ctot/cts[i]))/sqrt(2.0);
+ fprintf(fh, "%10.3f %10.2f\n", cen*1.0e-9, r*100.0);
}