aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw27@cam.ac.uk>2009-04-08 20:11:54 +0100
committerThomas White <taw27@cam.ac.uk>2009-04-08 20:11:54 +0100
commit5083b9a0eb1dc3a018eacb25dc02d29be4d992f5 (patch)
treea1b8d783f6920fbda46333e0d6ea133e5abe246c
parentfa0eaf181b87f51e39e7ba019f4a341955cbb0a0 (diff)
Fix reflections.c, which was comically broken
-rw-r--r--src/reflections.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/reflections.c b/src/reflections.c
index 8235391..ce5f7a9 100644
--- a/src/reflections.c
+++ b/src/reflections.c
@@ -111,6 +111,9 @@ Reflection *reflection_add(ReflectionList *reflectionlist, double x, double y, d
new_reflection->x = x;
new_reflection->y = y;
new_reflection->z = z;
+ new_reflection->h = 999;
+ new_reflection->k = 333;
+ new_reflection->l = 111;
new_reflection->intensity = intensity;
new_reflection->type = type;
new_reflection->found = 0;
@@ -243,22 +246,21 @@ ReflectionList *reflection_list_from_cell(Basis *basis) {
double x, y, z;
- /* Test mode */
- //if ( h != 0 ) continue;
-
x = h*basis->a.x + k*basis->b.x + l*basis->c.x;
y = h*basis->a.y + k*basis->b.y + l*basis->c.y;
z = h*basis->a.z + k*basis->b.z + l*basis->c.z;
if ( ( x*x + y*y + z*z ) <= max_res*max_res ) {
- Reflection *ref;
- ref = reflection_add(ordered, x, y, z, 1.0, REFLECTION_GENERATED);
- if ( ref ) { /* Check it's not NULL */
- ref->h = h; ref->k = k; ref->l = l;
- }
if ( (h!=0) || (k!=0) || (l!=0) ) {
- // reflection_add(ctx->reflectionlist, x, y, z, 1.0, REFLECTION_GENERATED);
- reflection_add(ordered, x, y, z, 1.0, REFLECTION_GENERATED);
+ Reflection *ref;
+ ref = reflection_add(ordered,
+ x, y, z, 1.0,
+ REFLECTION_GENERATED);
+ if ( ref ) {
+ ref->h = h;
+ ref->k = k;
+ ref->l = l;
+ }
}
}