diff options
author | Thomas White <taw@physics.org> | 2010-09-29 11:59:08 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:00 +0100 |
commit | 68cdb985f3c321207b5a23111d8ba157c9529531 (patch) | |
tree | 08037e29409132561577bd9125b736b96baf8694 /src/compare_hkl.c | |
parent | f0e026ef7c6ccc4a5b92ffb20d14484f02d59c05 (diff) |
compare_hkl: Change resolution conventions (a bit)
Diffstat (limited to 'src/compare_hkl.c')
-rw-r--r-- | src/compare_hkl.c | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/src/compare_hkl.c b/src/compare_hkl.c index 6cfcd5f4..d918e5cb 100644 --- a/src/compare_hkl.c +++ b/src/compare_hkl.c @@ -78,14 +78,14 @@ static void plot_shells(const double *ref1, const double *ref2, struct refl_item *it; signed int h, k, l; - double res; + double d; it = get_item(items, i); h = it->h; k = it->k; l = it->l; - res = 2.0*resolution(cell, h, k, l); - if ( res > rmax ) rmax = res; - if ( res < rmin ) rmin = res; + d = 0.5/resolution(cell, h, k, l); + if ( d > rmax ) rmax = d; + if ( d < rmin ) rmin = d; } rstep = (rmax-rmin) / NBINS; @@ -94,22 +94,26 @@ static void plot_shells(const double *ref1, const double *ref2, struct refl_item *it; signed int h, k, l; - double res; + double d; int bin; - double i1, i2; + double i1, i2, f1, f2; it = get_item(items, i); h = it->h; k = it->k; l = it->l; - res = 2.0*resolution(cell, h, k, l); + d = 0.5/resolution(cell, h, k, l); - bin = (res-rmin)/rstep; + bin = (d-rmin)/rstep; i1 = lookup_intensity(ref1, h, k, l); - i2 = scale * lookup_intensity(ref2, h, k, l); + if ( i1 < 0.0 ) continue; + f1 = sqrt(i1); + i2 = lookup_intensity(ref2, h, k, l); + if ( i2 < 0.0 ) continue; + f2 = sqrt(i2); - num[bin] += pow(i1 - i2, 2.0); - den[bin] += pow(i1, 2.0); + num[bin] += fabs(f1 - f2); + den[bin] += fabs(f1 + f2) / 2.0; } @@ -117,8 +121,8 @@ static void plot_shells(const double *ref1, const double *ref2, double r2, cen; cen = rmin + rstep*i + rstep/2.0; - r2 = sqrt(num[i]/den[i]); - fprintf(fh, "%f %f\n", cen/1.0e9, r2*100.0); + r2 = num[i]/den[i]; + fprintf(fh, "%f %f\n", cen/1.0e-10, r2*100.0); } @@ -235,6 +239,7 @@ int main(int argc, char *argv[]) double val1, val2; double sig1, sig2; int ig = 0; + double d; it = get_item(i1, i); h = it->h; k = it->k; l = it->l; @@ -258,6 +263,11 @@ int main(int argc, char *argv[]) rej2++; ig = 1; } + + d = 0.5/resolution(cell, h, k, l); + if ( d > 55.0e-10 ) ig = 1; + //if ( d < 15.0e-10 ) ig = 1; + if ( ig ) continue; set_intensity(ref2_transformed, h, k, l, val2); |