aboutsummaryrefslogtreecommitdiff
path: root/src/process_hkl.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-09-24 18:12:08 +0200
committerThomas White <taw@physics.org>2012-02-22 15:26:59 +0100
commit7b3e720829c62b63259b65ede4a4006e4417b32e (patch)
tree73a38f55aa85b1d9d6924de9cc4820fe108096df /src/process_hkl.c
parent7e146b3b58eef65e630c082af362342e04eae099 (diff)
process_hkl: Add intensity per peak scaling
Diffstat (limited to 'src/process_hkl.c')
-rw-r--r--src/process_hkl.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/process_hkl.c b/src/process_hkl.c
index b9a3fbd6..0df12e75 100644
--- a/src/process_hkl.c
+++ b/src/process_hkl.c
@@ -307,7 +307,8 @@ static void merge_pattern(double *model, ReflItemList *observed,
enum {
SCALE_NONE,
SCALE_CONSTINT,
- SCALE_TWOPASS
+ SCALE_INTPERBRAGG,
+ SCALE_TWOPASS,
};
@@ -319,7 +320,7 @@ static void scale_intensities(const double *model, ReflItemList *model_items,
double top = 0.0;
double bot = 0.0;
unsigned int i;
- const int scaling = SCALE_CONSTINT;
+ const int scaling = SCALE_INTPERBRAGG;
for ( i=0; i<num_items(new_items); i++ ) {
@@ -354,6 +355,15 @@ static void scale_intensities(const double *model, ReflItemList *model_items,
break;
+ case SCALE_INTPERBRAGG :
+
+ /* Sum up the intensity in the pattern */
+ i2 = lookup_intensity(new_pattern, it->h, it->k, it->l);
+ top += i2;
+ bot += 1.0;
+
+ break;
+
}
}
@@ -365,6 +375,9 @@ static void scale_intensities(const double *model, ReflItemList *model_items,
case SCALE_CONSTINT :
s = 1000.0 / top;
break;
+ case SCALE_INTPERBRAGG :
+ s = 1000.0 / (top/bot);
+ break;
}
//if ( f0_valid ) printf("%f %f\n", s, f0);