aboutsummaryrefslogtreecommitdiff
path: root/src/hrs-scaling.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-07-07 10:48:50 +0200
committerThomas White <taw@physics.org>2012-02-22 15:27:32 +0100
commit401e76a10f4d246e2d62dea0808a440bec488a09 (patch)
tree6a986c62ade2f3d27a8c5eeea8d7d716f2839f52 /src/hrs-scaling.c
parentc599be94db27e28366d0f2aa80846bcc9aa7b536 (diff)
No need to save "uh" and "vh" in tables - they're only used once
This also removes another instance of the old reflection list
Diffstat (limited to 'src/hrs-scaling.c')
-rw-r--r--src/hrs-scaling.c27
1 files changed, 2 insertions, 25 deletions
diff --git a/src/hrs-scaling.c b/src/hrs-scaling.c
index f5c43478..af808338 100644
--- a/src/hrs-scaling.c
+++ b/src/hrs-scaling.c
@@ -220,8 +220,6 @@ static double iterate_scale(struct image *images, int n, RefList *scalable,
gsl_vector *v;
gsl_vector *shifts;
double max_shift;
- double *uh_arr;
- double *vh_arr;
double *uha_arr;
double *vha_arr;
int frame;
@@ -231,23 +229,6 @@ static double iterate_scale(struct image *images, int n, RefList *scalable,
M = gsl_matrix_calloc(n, n);
v = gsl_vector_calloc(n);
- uh_arr = new_list_intensity();
- vh_arr = new_list_intensity();
- for ( refl = first_refl(scalable, &iter);
- refl != NULL;
- refl = next_refl(refl, iter) )
- {
- double uh, vh;
- signed int h, k, l;
-
- get_indices(refl, &h, &k, &l);
-
- s_uhvh(images, n, h, k, l, &uh, &vh);
-
- set_intensity(uh_arr, h, k, l, uh);
- set_intensity(vh_arr, h, k, l, vh);
- }
-
uha_arr = malloc(n*sizeof(double));
vha_arr = malloc(n*sizeof(double));
@@ -257,15 +238,13 @@ static double iterate_scale(struct image *images, int n, RefList *scalable,
{
int a;
signed int h, k, l;
- double uh, Ih;
+ double uh, vh, Ih;
get_indices(refl, &h, &k, &l);
- uh = lookup_intensity(uh_arr, h, k, l);
+ s_uhvh(images, n, h, k, l, &uh, &vh);
if ( !reference ) {
- double vh;
- vh = lookup_intensity(vh_arr, h, k, l);
Ih = vh / uh;
/* 0 / 0 = 0, not NaN */
if ( isnan(Ih) ) Ih = 0.0;
@@ -351,8 +330,6 @@ static double iterate_scale(struct image *images, int n, RefList *scalable,
}
}
- free(uh_arr);
- free(vh_arr);
free(uha_arr);
free(vha_arr);