From 73629ee82c643769ddff3caa437f9e842f353b23 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 11 Jun 2014 16:01:31 +0200 Subject: Fix ReAx logic --- libcrystfel/src/reax.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'libcrystfel/src/reax.c') diff --git a/libcrystfel/src/reax.c b/libcrystfel/src/reax.c index 1ff61a59..5448d1a7 100644 --- a/libcrystfel/src/reax.c +++ b/libcrystfel/src/reax.c @@ -3,11 +3,13 @@ * * A new auto-indexer * - * Copyright © 2012-2013 Deutsches Elektronen-Synchrotron DESY, + * Copyright © 2012-2014 Deutsches Elektronen-Synchrotron DESY, * a research centre of the Helmholtz Association. + * Copyright © 2014 Takanori Nakane * * Authors: - * 2011-2013 Thomas White + * 2011-2014 Thomas White + * 2014 Takanori Nakane * * This file is part of CrystFEL. * @@ -957,20 +959,21 @@ static int check_cell(struct reax_private *dp, struct image *image, } -static void assemble_cells_from_candidates(struct image *image, +static int assemble_cells_from_candidates(struct image *image, struct reax_search *s, UnitCell *cell, struct reax_private *p) { int i, j, k; signed int ti, tj, tk; + int rval; struct cell_candidate_list cl; cl.cand = calloc(MAX_REAX_CELL_CANDIDATES, sizeof(struct cell_candidate)); if ( cl.cand == NULL ) { ERROR("Failed to allocate cell candidate list.\n"); - return; + return 0; } cl.n_cand = 0; @@ -1011,8 +1014,6 @@ static void assemble_cells_from_candidates(struct image *image, continue; } - /* FIXME! */ - //peak_lattice_agreement(image, cnew, &fom); fom = 1.0; add_cell_candidate(&cl, cnew, fom); @@ -1043,11 +1044,16 @@ static void assemble_cells_from_candidates(struct image *image, } } + rval = 0; for ( i=0; iplan, smin, smax, // image->det, p); - assemble_cells_from_candidates(image, s, p->cell, p); + rval = assemble_cells_from_candidates(image, s, p->cell, p); for ( i=0; in_search; i++ ) { free(s->search[i].cand); @@ -1091,7 +1098,7 @@ int reax_index(IndexingPrivate *pp, struct image *image) free(s); fftw_free(fft_in); fftw_free(fft_out); - return 1; + return rval; } -- cgit v1.2.3