aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-08-31 20:31:07 +0200
committerThomas White <taw@physics.org>2018-08-31 20:31:07 +0200
commit69ee7568d425c531991e708f1a0ad9f48bf0b4c9 (patch)
tree7d36363110f78b4b4dbf68c7e8e17298b32386bb
parent90f96d061805b604cb976d9ab5aa1cf236269cc5 (diff)
Show number of reflections used for CC calculation
-rw-r--r--src/rejection.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/rejection.c b/src/rejection.c
index 6ff7265d..47cc9347 100644
--- a/src/rejection.c
+++ b/src/rejection.c
@@ -95,7 +95,7 @@ void early_rejection(Crystal **crystals, int n)
static double calculate_cchalf(RefList *template, RefList *full,
- Crystal *exclude)
+ Crystal *exclude, int *pnref)
{
Reflection *trefl;
RefListIterator *iter;
@@ -156,6 +156,9 @@ static double calculate_cchalf(RefList *template, RefList *full,
sig2E = all_sum_var / n;
sig2Y = (all_sumsq_mean - all_sum_mean*all_sum_mean)*n/(n-1);
+ if ( pnref != NULL ) {
+ *pnref = n;
+ }
return (sig2Y - 0.5*sig2E) / (sig2Y + 0.5*sig2E);
}
@@ -164,17 +167,22 @@ static void check_deltacchalf(Crystal **crystals, int n, RefList *full)
{
double cchalf;
int i;
+ int nref;
- cchalf = calculate_cchalf(full, full, NULL);
- STATUS("Overall CChalf = %f\n", cchalf);
+ cchalf = calculate_cchalf(full, full, NULL, &nref);
+ STATUS("Overall CChalf = %f (%i reflections)\n", cchalf*100.0, nref);
for ( i=0; i<n; i++ ) {
double cchalf, cchalfi;
- cchalf = calculate_cchalf(crystal_get_reflections(crystals[i]),
- full, NULL);
- cchalfi = calculate_cchalf(crystal_get_reflections(crystals[i]),
- full, crystals[i]);
- STATUS("DeltaCChalf_%i = %e\n", i, cchalfi - cchalf);
+ RefList *template = crystal_get_reflections(crystals[i]);
+ //RefList *template = full;
+ cchalf = calculate_cchalf(template, full, NULL, NULL);
+ cchalfi = calculate_cchalf(template, full, crystals[i], &nref);
+ STATUS("Frame %i:\n", i);
+ STATUS(" With = %f\n", cchalf*100.0);
+ STATUS("Without = %f\n", cchalfi*100.0);
+ STATUS("Delta = %f\n", cchalf - cchalfi);
+ STATUS("nref = %i\n", nref);
}
}