aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-01-27 19:20:44 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:12 +0100
commit78647accb62ac3b609c9660e2600211933e8ef09 (patch)
tree817db21c8a4b68ff66e777bae73d6dcdace6e4b6 /src
parent964dffbc22fed3d6cb08fb257e6d0c6269dc49fb (diff)
Can't ignore the weightings completely..
Diffstat (limited to 'src')
-rw-r--r--src/hrs-scaling.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/hrs-scaling.c b/src/hrs-scaling.c
index a03cd93f..690e5779 100644
--- a/src/hrs-scaling.c
+++ b/src/hrs-scaling.c
@@ -61,7 +61,7 @@ static void show_eigen(gsl_matrix *e_vec, gsl_vector *e_val, int r)
static double s_uha(signed int hat, signed int kat, signed int lat,
- struct image *images, int n, const char *sym)
+ struct image *images, int n, const char *sym, int a)
{
int k;
double val = 0.0;
@@ -72,6 +72,8 @@ static double s_uha(signed int hat, signed int kat, signed int lat,
struct image *image = &images[k];
struct cpeak *spots = images->cpeaks;
+ if ( k != a ) continue;
+
for ( hi=0; hi<image->n_cpeaks; hi++ ) {
double ic, sigi;
@@ -99,7 +101,7 @@ static double s_uha(signed int hat, signed int kat, signed int lat,
static double s_vha(signed int hat, signed int kat, signed int lat,
- struct image *images, int n, const char *sym)
+ struct image *images, int n, const char *sym, int a)
{
int k;
double val = 0.0;
@@ -110,6 +112,8 @@ static double s_vha(signed int hat, signed int kat, signed int lat,
struct image *image = &images[k];
struct cpeak *spots = images->cpeaks;
+ if ( k != a ) continue;
+
for ( hi=0; hi<image->n_cpeaks; hi++ ) {
double ic, sigi;
@@ -195,8 +199,8 @@ static double iterate_scale(struct image *images, int n,
struct refl_item *it = get_item(obs, h);
/* Determine the "solution" vector component */
- vha = s_vha(it->h, it->k, it->l, images, n, sym);
- uha = s_uha(it->h, it->k, it->l, images, n, sym);
+ vha = s_vha(it->h, it->k, it->l, images, n, sym, a);
+ uha = s_uha(it->h, it->k, it->l, images, n, sym, a);
uh = s_uh(images, n, uha);
Ih = s_vh(images, n, vha) / uh;
rha = vha - image_a->osf * uha * Ih;
@@ -217,8 +221,10 @@ static double iterate_scale(struct image *images, int n,
bcomp = b;
if ( b > crossed ) bcomp--;
- vhb = vha; /* Because we ignore the weights */
- uhb = uha; /* Same as above */
+ vhb = s_vha(it->h, it->k, it->l, images, n,
+ sym, b);
+ uhb = s_uha(it->h, it->k, it->l, images, n,
+ sym, b);
rhb = vhb - image_b->osf * uhb * Ih;
mc = (rha*vhb + vha*rhb - vha*vhb) / uh;