diff options
author | Thomas White <taw@physics.org> | 2010-08-20 17:11:49 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:26:56 +0100 |
commit | 06ad4f710ced8ef552e8ddde7fc6d92b2bde5fdc (patch) | |
tree | 9b65ffe55687f49991a283fe4a849c69e3f3b496 /src | |
parent | a66b13709f0ce9a3fd9d4938344533555eb6c24c (diff) |
Output the cell from template matching
Diffstat (limited to 'src')
-rw-r--r-- | src/index.c | 2 | ||||
-rw-r--r-- | src/templates.c | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/index.c b/src/index.c index 2a5eb5b7..8f563990 100644 --- a/src/index.c +++ b/src/index.c @@ -130,7 +130,7 @@ void index_pattern(struct image *image, UnitCell *cell, IndexingMethod indm, return; } - if ( no_match ) { + if ( no_match || (indm == INDEXING_TEMPLATE) ) { image->indexed_cell = image->candidate_cells[0]; if ( verbose ) { STATUS("--------------------\n"); 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); + } |