aboutsummaryrefslogtreecommitdiff
path: root/src/intensities.c
diff options
context:
space:
mode:
authortaw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1>2008-01-07 18:06:05 +0000
committertaw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1>2008-01-07 18:06:05 +0000
commita48ab02eddace230f198ae8445c45190a8f1c179 (patch)
treef728dd65afadfcfa98ef076ef0ed485c107d518a /src/intensities.c
parent1ee5beff75915df1c9d30cf816ba41f49c734e99 (diff)
Record the strongest of duplicated measurements
git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@241 bf6ca9ba-c028-0410-8290-897cf20841d1
Diffstat (limited to 'src/intensities.c')
-rw-r--r--src/intensities.c37
1 files changed, 31 insertions, 6 deletions
diff --git a/src/intensities.c b/src/intensities.c
index af04c8e..2d56b30 100644
--- a/src/intensities.c
+++ b/src/intensities.c
@@ -64,26 +64,51 @@ void intensities_extract(ControlContext *ctx) {
if ( (h!=0) || (k!=0) || (l!=0) ) {
double intensity;
- Reflection *new;
+ Reflection *ref;
/* Perform relrod calculation of doom here.
* TODO: Figure out if this is even possible. */
intensity = feature->partner->intensity;
- new = reflection_add(ctx->integrated,
+ ref = reflectionlist_find(ctx->integrated, h, k, l);
+
+ if ( ref == NULL ) {
+
+ Reflection *new;
+
+ printf("IN: Adding %3i %3i %3i, intensity=%f\n", h, k, l, intensity);
+
+ new = reflection_add(ctx->integrated,
feature->reflection->x, feature->reflection->y, feature->reflection->z,
intensity, REFLECTION_GENERATED);
-
- if ( new != NULL ) {
+
new->h = h;
new->k = k;
new->l = l;
- //printf("IN: Adding %3i %3i %3i, intensity=%f\n", h, k, l, intensity);
+
if ( intensity > max ) max = intensity;
+
n_meas++;
+
} else {
- printf("IN: Duplicate measurement for %3i %3i %3i\n", h, k, l);
+
+ printf("IN: Duplicate measurement for %3i %3i %3i - ", h, k, l);
+
+ if ( intensity > ref->intensity ) {
+
+ printf("stronger.\n");
+
+ ref->x = feature->reflection->x;
+ ref->y = feature->reflection->y;
+ ref->z = feature->reflection->z;
+ ref->intensity = intensity;
+
+ } else {
+ printf("weaker.\n");
+ }
+
n_dupl++;
+
}
}