aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-03-25 11:52:44 +0100
committerThomas White <taw@physics.org>2010-03-25 11:52:44 +0100
commitf93bd1a5a69ad5061a1289bf77c701c13275842f (patch)
tree4feb8895402c581cb9b807dedaa4e84728d136a3 /src
parentb2db1f5f8883c4e1b3d527cc034e652f15f0c02e (diff)
Fix twinning (take account of space group symmetry)
Diffstat (limited to 'src')
-rw-r--r--src/get_hkl.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/get_hkl.c b/src/get_hkl.c
index 5e34e185..7ce753c3 100644
--- a/src/get_hkl.c
+++ b/src/get_hkl.c
@@ -181,13 +181,25 @@ int main(int argc, char *argv[])
for ( k=-INDMAX; k<=INDMAX; k++ ) {
for ( l=-INDMAX; l<=INDMAX; l++ ) {
- double a, b;
+ double a, b, c, d;
+ double t;
+
+ if ( abs(h+k) > INDMAX ) {
+ set_intensity(ideal_ref, h, k, l, 0.0);
+ continue;
+ }
a = lookup_intensity(ideal_ref, h, k, l);
b = lookup_intensity(ideal_ref, k, h, -l);
+ c = lookup_intensity(ideal_ref, -(h+k), k, -l);
+ d = lookup_intensity(ideal_ref, -(h+k), h, l);
+
+ t = (a+b+c+d)/4.0;
- set_intensity(ideal_ref, h, k, l, (a+b)/2.0);
- set_intensity(ideal_ref, k, h, -l, (a+b)/2.0);
+ set_intensity(ideal_ref, h, k, l, t);
+ set_intensity(ideal_ref, k, h, -l, t);
+ set_intensity(ideal_ref, -(h+k), h, l, t);
+ set_intensity(ideal_ref, -(h+k), k, -l, t);
}
}