From 32e1b660775a2b5026e9b5ddbda94644f93b6653 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 17 Jun 2011 15:06:14 +0200 Subject: Unify uh and vh calculations --- src/hrs-scaling.c | 41 +++++++++++++++++------------------------ 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/src/hrs-scaling.c b/src/hrs-scaling.c index 0876e448..f0978ddb 100644 --- a/src/hrs-scaling.c +++ b/src/hrs-scaling.c @@ -91,47 +91,41 @@ static void s_uhavha(signed int hat, signed int kat, signed int lat, if ( !get_scalable(refl) ) continue; ic = get_intensity(refl) / get_partiality(refl); - sigi = fabs(ic)/10.0; /* FIXME */ + sigi = 10.0; /* FIXME */ uha_val += 1.0 / pow(sigi, 2.0); vha_val += ic / pow(sigi, 2.0); } - if ( uha != NULL ) *uha = uha_val; - if ( vha != NULL ) *vha = vha_val; + *uha = uha_val; + *vha = vha_val; } -static double s_uh(struct image *images, int n, - signed int h, signed int k, signed int l, const char *sym) +static void s_uhvh(struct image *images, int n, + signed int h, signed int k, signed int l, const char *sym, + double *uhp, double *vhp) { int a; - double val = 0.0; + double uh = 0.0; + double vh = 0.0; for ( a=0; ah, it->k, it->l, sym); - vh = s_vh(images, n, it->h, it->k, it->l, sym); + s_uhvh(images, n, it->h, it->k, it->l, sym, &uh, &vh); set_intensity(uh_arr, it->h, it->k, it->l, uh); set_intensity(vh_arr, it->h, it->k, it->l, vh); -- cgit v1.2.3