aboutsummaryrefslogtreecommitdiff
path: root/src/partial_sim.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-04-21 14:45:48 +0200
committerThomas White <taw@physics.org>2012-02-22 15:27:24 +0100
commit9ade59074851b3d0964f52bd25ae1861efd7f89d (patch)
tree460acadd6fd2f4dfd40be61435001a646b193308 /src/partial_sim.c
parentdc0e8347b99d75e2b66fe8c72d0f2e3ae8e2f244 (diff)
partial_sim: Split off mess_up_cell()
Diffstat (limited to 'src/partial_sim.c')
-rw-r--r--src/partial_sim.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/partial_sim.c b/src/partial_sim.c
index f1fcfc5b..824b1b5d 100644
--- a/src/partial_sim.c
+++ b/src/partial_sim.c
@@ -31,6 +31,18 @@
#include "stream.h"
+
+static void mess_up_cell(UnitCell *cell)
+{
+ double ax, ay, az;
+ double bx, by, bz;
+ double cx, cy, cz;
+
+ cell_get_cartesian(cell, &ax, &ay, &az, &bx, &by, &bz, &cx, &cy, &cz);
+ ax += 0.01 * ax;
+ cell_set_cartesian(cell, ax, ay, az, bx, by, bz, cx, cy, cz);
+}
+
/* For each reflection in "partial", fill in what the intensity would be
* according to "full" */
static void calculate_partials(RefList *partial, double osf,
@@ -97,7 +109,6 @@ int main(int argc, char *argv[])
RefList *full;
char *sym = NULL;
UnitCell *cell = NULL;
- UnitCell *rcell;
struct quaternion orientation;
struct image image;
FILE *ofh;
@@ -240,11 +251,8 @@ int main(int argc, char *argv[])
write_chunk(ofh, &image, STREAM_INTEGRATED);
reflist_free(image.reflections);
- /* Rotate the cell by a tiny amount */
- rcell = rotate_cell(image.indexed_cell,
- deg2rad(0.2), deg2rad(0.0), deg2rad(0.0));
- cell_free(image.indexed_cell);
- image.indexed_cell = rcell;
+ /* Alter the cell by a tiny amount */
+ mess_up_cell(image.indexed_cell);
image.filename = "(simulated 2)";
/* Write another chunk */