From bff069f97ad705b44e0432f93597a874d19baa8a Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 11 Oct 2019 10:54:25 +0200 Subject: Copy target cell's lattice type and unique axis into cell from indexing, after comparison --- libcrystfel/src/index.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'libcrystfel') diff --git a/libcrystfel/src/index.c b/libcrystfel/src/index.c index 016767a9..d24e8355 100644 --- a/libcrystfel/src/index.c +++ b/libcrystfel/src/index.c @@ -587,10 +587,21 @@ static int check_cell(IndexingFlags flags, Crystal *cr, UnitCell *target, tolerance, &rm); if ( out != NULL ) { + /* Replace crystal's cell with new one */ cell_free(crystal_get_cell(cr)); crystal_set_cell(cr, out); rtnl_mtx_free(rm); + + /* Copy the target cell's lattice type and unique axis + * onto the crystal's cell. The cell from compare_r_c_p doesn't + * (yet) have the right values, because cell_transform_rational + * don't know how to determine them. The cell should be close + * to the target, of course, so this is less bad than leaving + * the lattice type as triclinic. */ + cell_set_lattice_type(out, cell_get_lattice_type(target)); + cell_set_unique_axis(out, cell_get_unique_axis(target)); + return 0; } -- cgit v1.2.3