diff options
author | Thomas White <taw@bitwiz.org.uk> | 2010-10-31 10:41:22 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:04 +0100 |
commit | 9686edbcb2b5aeb4a553779c895b228d2ac56528 (patch) | |
tree | ad741bdba9bc91c27c27a82c11485db925b82f52 /src/index.c | |
parent | 6c823bf1a6ce09e716c486dc116a358e93457a17 (diff) |
indexamajig: Add other cell reduction possibilities, and remove --no-match
Diffstat (limited to 'src/index.c')
-rw-r--r-- | src/index.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/index.c b/src/index.c index 0c656042..f285cccb 100644 --- a/src/index.c +++ b/src/index.c @@ -124,7 +124,7 @@ void map_all_peaks(struct image *image) void index_pattern(struct image *image, UnitCell *cell, IndexingMethod indm, - int no_match, int verbose, IndexingPrivate *ipriv) + int cellr, int verbose, IndexingPrivate *ipriv) { int i; @@ -150,7 +150,7 @@ void index_pattern(struct image *image, UnitCell *cell, IndexingMethod indm, return; } - if ( no_match || (indm == INDEXING_TEMPLATE) ) { + if ( (cellr == CELLR_NONE) || (indm == INDEXING_TEMPLATE) ) { image->indexed_cell = image->candidate_cells[0]; if ( verbose ) { STATUS("--------------------\n"); @@ -172,7 +172,22 @@ void index_pattern(struct image *image, UnitCell *cell, IndexingMethod indm, STATUS("--------------------\n"); } - new_cell = match_cell(image->candidate_cells[i], cell, verbose); + /* Match or reduce the cell as appropriate */ + switch ( cellr ) { + case CELLR_NONE : + /* Never happens */ + break; + case CELLR_REDUCE : + new_cell = match_cell(image->candidate_cells[i], + cell, verbose); + break; + case CELLR_COMPARE : + if ( cells_similar(image->candidate_cells[i], cell) ) { + new_cell = image->candidate_cells[i]; + } + break; + } + image->indexed_cell = new_cell; if ( new_cell != NULL ) { STATUS("Matched on attempt %i.\n", i); |