aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/hrs-scaling.c23
-rw-r--r--src/partialator.c31
-rw-r--r--src/post-refinement.c8
3 files changed, 33 insertions, 29 deletions
diff --git a/src/hrs-scaling.c b/src/hrs-scaling.c
index 8e17bee7..c0308483 100644
--- a/src/hrs-scaling.c
+++ b/src/hrs-scaling.c
@@ -375,29 +375,6 @@ double *scale_intensities(struct image *images, int n, const char *sym,
/* Start with all scale factors equal */
for ( m=0; m<n; m++ ) images[m].osf = 1.0;
- /* Decide which reflections can be scaled */
- for ( m=0; m<n; m++ ) {
-
- int j;
-
- for ( j=0; j<images[m].n_cpeaks; j++ ) {
-
- int scalable = 1;
-
- if ( images[m].cpeaks[j].p < 0.1 ) scalable = 0;
- if ( !images[m].cpeaks[j].valid ) {
- scalable = 0;
- } else {
- double v = fabs(images[m].cpeaks[j].intensity);
- if ( v < 0.1 ) scalable = 0;
- }
-
- images[m].cpeaks[j].scalable = scalable;
-
- }
-
- }
-
/* Iterate */
i = 0;
do {
diff --git a/src/partialator.c b/src/partialator.c
index 0e727ead..420638bf 100644
--- a/src/partialator.c
+++ b/src/partialator.c
@@ -232,6 +232,35 @@ static void integrate_image(struct image *image, ReflItemList *obs)
}
+/* Decide which reflections can be scaled */
+static void select_scalable_reflections(struct image *images, int n)
+{
+ int m;
+
+ for ( m=0; m<n; m++ ) {
+
+ int j;
+
+ for ( j=0; j<images[m].n_cpeaks; j++ ) {
+
+ int scalable = 1;
+
+ if ( images[m].cpeaks[j].p < 0.1 ) scalable = 0;
+ if ( !images[m].cpeaks[j].valid ) {
+ scalable = 0;
+ } else {
+ double v = fabs(images[m].cpeaks[j].intensity);
+ if ( v < 0.1 ) scalable = 0;
+ }
+
+ images[m].cpeaks[j].scalable = scalable;
+
+ }
+
+ }
+}
+
+
int main(int argc, char *argv[])
{
int c;
@@ -432,6 +461,7 @@ int main(int argc, char *argv[])
/* Make initial estimates */
STATUS("Performing initial scaling.\n");
+ select_scalable_reflections(images, n_total_patterns);
I_full = scale_intensities(images, n_total_patterns, sym, obs);
/* Iterate */
@@ -463,6 +493,7 @@ int main(int argc, char *argv[])
/* Re-estimate all the full intensities */
free(I_full);
+ select_scalable_reflections(images, n_total_patterns);
I_full = scale_intensities(images, n_total_patterns, sym, obs);
fclose(fhg);
diff --git a/src/post-refinement.c b/src/post-refinement.c
index ffa9dbcc..da7c86b6 100644
--- a/src/post-refinement.c
+++ b/src/post-refinement.c
@@ -237,9 +237,7 @@ double mean_partial_dev(struct image *image, struct cpeak *spots, int n,
kind = spots[h].k;
lind = spots[h].l;
- /* Don't attempt to use spots with very small
- * partialities, since it won't be accurate. */
- if ( spots[h].p < 0.1 ) continue;
+ if ( !spots[h].scalable ) continue;
/* Actual measurement of this reflection from this
* pattern? */
@@ -309,9 +307,7 @@ double pr_iterate(struct image *image, double *i_full, const char *sym,
kind = spots[h].k;
lind = spots[h].l;
- /* Don't attempt to use spots with very small
- * partialities, since it won't be accurate. */
- if ( spots[h].p < 0.1 ) continue;
+ if ( !spots[h].scalable ) continue;
/* Actual measurement of this reflection from this
* pattern? */