aboutsummaryrefslogtreecommitdiff
path: root/src/templates.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-08-20 17:11:49 +0200
committerThomas White <taw@physics.org>2012-02-22 15:26:56 +0100
commit06ad4f710ced8ef552e8ddde7fc6d92b2bde5fdc (patch)
tree9b65ffe55687f49991a283fe4a849c69e3f3b496 /src/templates.c
parenta66b13709f0ce9a3fd9d4938344533555eb6c24c (diff)
Output the cell from template matching
Diffstat (limited to 'src/templates.c')
-rw-r--r--src/templates.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/templates.c b/src/templates.c
index 465da62c..ab707e3d 100644
--- a/src/templates.c
+++ b/src/templates.c
@@ -32,6 +32,7 @@
struct _indexingprivate_template
{
struct _indexingprivate base;
+ UnitCell *cell;
int n_templates;
struct template *templates;
};
@@ -177,6 +178,7 @@ IndexingPrivate *generate_templates(UnitCell *cell, const char *filename,
}
priv->n_templates = n_templates;
+ priv->cell = cell_new_from_cell(cell);
return (struct _indexingprivate *)priv;
}
@@ -261,4 +263,10 @@ void match_templates(struct image *image, IndexingPrivate *ipriv)
STATUS("%i (%.2f, %.2f): %.2f%%\n", max_i, priv->templates[max_i].omega,
priv->templates[max_i].phi,
100.0 * max / tot);
+
+ image->ncells = 1;
+ image->candidate_cells[0] = rotate_cell(priv->cell,
+ priv->templates[max_i].omega,
+ priv->templates[max_i].phi);
+
}