Commit 1e6a810a authored by Thomas White's avatar Thomas White
Browse files

compare_hkl: Calculate Rsplit in shells, and say what it is

parent fba222a2
......@@ -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);
}
......
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