diff options
author | Thomas White <taw@bitwiz.org.uk> | 2011-02-02 22:56:21 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:12 +0100 |
commit | eac6ae7c88b6f74a7a9e5fc19796b897ad6ff630 (patch) | |
tree | 55dc07cef048a10fad402da265764fe67d746cb9 | |
parent | 7d746322e9c108c51c4a8d6d04390338438c2fb0 (diff) |
Decide once only on which reflections are scalable
-rw-r--r-- | src/hrs-scaling.c | 29 | ||||
-rw-r--r-- | src/image.h | 2 |
2 files changed, 25 insertions, 6 deletions
diff --git a/src/hrs-scaling.c b/src/hrs-scaling.c index d0e0d589..809298a7 100644 --- a/src/hrs-scaling.c +++ b/src/hrs-scaling.c @@ -52,8 +52,8 @@ static double s_uha(signed int hat, signed int kat, signed int lat, double ic, sigi; signed int ha, ka, la; - if ( !spots[hi].valid ) continue; - if ( spots[hi].p < 0.1 ) continue; + if ( !spots[hi].scalable ) continue; + get_asymm(spots[hi].h, spots[hi].k, spots[hi].l, &ha, &ka, &la, sym); if ( ha != hat ) continue; @@ -92,8 +92,8 @@ static double s_vha(signed int hat, signed int kat, signed int lat, double ic, sigi; signed int ha, ka, la; - if ( !spots[hi].valid ) continue; - if ( spots[hi].p < 0.1 ) continue; + if ( !spots[hi].scalable ) continue; + get_asymm(spots[hi].h, spots[hi].k, spots[hi].l, &ha, &ka, &la, sym); if ( ha != hat ) continue; @@ -303,8 +303,7 @@ static double *lsq_intensities(struct image *images, int n, signed int ha, ka, la; - if ( !images[m].cpeaks[a].valid ) continue; - if ( images[m].cpeaks[a].p < 0.1 ) continue; + if ( !images[m].cpeaks[a].scalable ) continue; /* Correct reflection? */ get_asymm(images[m].cpeaks[a].h, @@ -362,6 +361,24 @@ 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; + if ( images[m].cpeaks[j].intensity < 0.1 ) scalable = 0; + + images[m].cpeaks[j].scalable = scalable; + + } + + } + /* Iterate */ i = 0; do { diff --git a/src/image.h b/src/image.h index 9c0e6e47..273e1bba 100644 --- a/src/image.h +++ b/src/image.h @@ -74,6 +74,8 @@ struct cpeak int x; int y; + int scalable; + /* Intensity */ double intensity; }; |