aboutsummaryrefslogtreecommitdiff
path: root/src/compare_hkl.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-11-16 12:08:43 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:05 +0100
commita2bb3a864af159a0bcd9db808e89a3743981b108 (patch)
treeba27e1775640a07e3453fc7e1ce6bf9d2bfff8a6 /src/compare_hkl.c
parent181887ff6ec35a21751402b58b02f424c848242a (diff)
Move 'characterisation' stuff to a new program, check_hkl
Diffstat (limited to 'src/compare_hkl.c')
-rw-r--r--src/compare_hkl.c65
1 files changed, 12 insertions, 53 deletions
diff --git a/src/compare_hkl.c b/src/compare_hkl.c
index a0481559..0b3d5914 100644
--- a/src/compare_hkl.c
+++ b/src/compare_hkl.c
@@ -51,9 +51,7 @@ static void show_help(const char *s)
static void plot_shells(const double *ref1, const double *ref2,
ReflItemList *items, double scale, UnitCell *cell,
- const char *sym, ReflItemList *characterise,
- unsigned int *char_counts, const double *sigma,
- double rmin_fix, double rmax_fix)
+ const char *sym, double rmin_fix, double rmax_fix)
{
double num[NBINS];
int cts[NBINS];
@@ -71,9 +69,6 @@ static void plot_shells(const double *ref1, const double *ref2,
int i;
int ctot;
FILE *fh;
- double snr_total = 0;
- int nmeas = 0;
- int nmeastot = 0;
int nout = 0;
if ( cell == NULL ) {
@@ -181,53 +176,9 @@ static void plot_shells(const double *ref1, const double *ref2,
}
free(counted);
- /* Characterise the first data set (only) */
- for ( i=0; i<num_items(characterise); i++ ) {
-
- struct refl_item *it;
- signed int h, k, l;
- double d;
- int bin;
- int j;
-
- it = get_item(characterise, i);
- h = it->h; k = it->k; l = it->l;
-
- d = resolution(cell, h, k, l) * 2.0;
-
- bin = -1;
- for ( j=0; j<NBINS; j++ ) {
- if ( (d>rmins[j]) && (d<=rmaxs[j]) ) {
- bin = j;
- break;
- }
- }
- if ( bin == -1 ) {
- nout++;
- continue;
- }
-
- measured[bin]++;
- measurements[bin] += lookup_count(char_counts, h, k, l);
- snr[bin] += (lookup_intensity(ref1, h, k, l) /
- lookup_intensity(sigma, h, k, l));
- snr_total += (lookup_intensity(ref1, h, k, l) /
- lookup_intensity(sigma, h, k, l));
- nmeas++;
- nmeastot += lookup_count(char_counts, h, k, l);
-
- }
- STATUS("overall <snr> = %f\n", snr_total/(double)nmeas);
- STATUS("%i measurements in total.\n", nmeastot);
- STATUS("%i reflections in total.\n", nmeas);
-
- if ( nout ) {
- STATUS("Warning; %i reflections outside resolution range.\n",
- nout);
- }
-
den = 0.0;
ctot = 0;
+ nout = 0;
for ( i=0; i<num_items(items); i++ ) {
struct refl_item *it;
@@ -251,7 +202,10 @@ static void plot_shells(const double *ref1, const double *ref2,
}
/* Outside resolution range? */
- if ( bin == -1 ) continue;
+ if ( bin == -1 ) {
+ nout++;
+ continue;
+ }
i1 = lookup_intensity(ref1, h, k, l);
i2 = lookup_intensity(ref2, h, k, l);
@@ -264,6 +218,11 @@ static void plot_shells(const double *ref1, const double *ref2,
}
+ if ( nout ) {
+ STATUS("Warning; %i reflections outside resolution range.\n",
+ nout);
+ }
+
for ( i=0; i<NBINS; i++ ) {
double r, cen;
@@ -496,7 +455,7 @@ int main(int argc, char *argv[])
if ( config_shells ) {
plot_shells(ref1, ref2_transformed, icommon, scale_r1fi,
- cell, sym, i1, cts1, esd1, rmin_fix, rmax_fix);
+ cell, sym, rmin_fix, rmax_fix);
}
if ( outfile != NULL ) {