From 13116e93b01faee7826b5ba95a1dbf5fc3d64b45 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 8 Feb 2013 15:52:19 -0800 Subject: Small tweaks --- libcrystfel/src/dirax.c | 2 +- libcrystfel/src/image.h | 14 +++----------- libcrystfel/src/mosflm.c | 1 + libcrystfel/src/reax.c | 8 ++++++-- 4 files changed, 11 insertions(+), 14 deletions(-) (limited to 'libcrystfel') diff --git a/libcrystfel/src/dirax.c b/libcrystfel/src/dirax.c index 2cbb0ec1..414e6406 100644 --- a/libcrystfel/src/dirax.c +++ b/libcrystfel/src/dirax.c @@ -91,7 +91,7 @@ struct dirax_data { int read_cell; int best_acl; int best_acl_nh; - int acls_tried[MAX_CELL_CANDIDATES]; + int acls_tried[MAX_DIRAX_CELL_CANDIDATES]; int n_acls_tried; UnitCell *cur_cell; int done; diff --git a/libcrystfel/src/image.h b/libcrystfel/src/image.h index 67fc9c49..8f9e296f 100644 --- a/libcrystfel/src/image.h +++ b/libcrystfel/src/image.h @@ -44,9 +44,6 @@ #include "crystal.h" -#define MAX_CELL_CANDIDATES (32) - - /* Structure describing a feature in an image */ struct imagefeature { @@ -112,14 +109,9 @@ typedef struct _imagefeaturelist ImageFeatureList; * by-product of the scattering vector calculation and can be used later for * calculating intensities from differential scattering cross sections. * - * candidate_cells is an array of unit cells directly - * returned by the low-level indexing system. ncells - * is the number of candidate unit cells which were found. The maximum number - * of cells which may be returned is MAX_CELL_CANDIDATES. - * indexed_cell contains the "correct" unit cell - * after cell reduction or matching has been performed. The job of the cell - * reduction is to convert the list of candidate cells into a single indexed - * cell, or NULL on failure. + * crystals is an array of %Crystal directly + * returned by the low-level indexing system. n_crystals + * is the number of crystals which were found in the image. * * copyme represents a list of HDF5 fields to copy * to the output stream. diff --git a/libcrystfel/src/mosflm.c b/libcrystfel/src/mosflm.c index d1d3c134..4f7b0c3c 100644 --- a/libcrystfel/src/mosflm.c +++ b/libcrystfel/src/mosflm.c @@ -643,6 +643,7 @@ int run_mosflm(struct image *image, IndexingPrivate *ipriv) mosflm->done = 0; mosflm->success = 0; + rval = 0; do { fd_set fds; diff --git a/libcrystfel/src/reax.c b/libcrystfel/src/reax.c index b144e266..4717dcb4 100644 --- a/libcrystfel/src/reax.c +++ b/libcrystfel/src/reax.c @@ -65,6 +65,9 @@ #define MAX_CANDIDATES (1024) +/* Choose the best solution from this many candidate cells */ +#define MAX_REAX_CELL_CANDIDATES (32) + struct dvec { double x; @@ -907,7 +910,7 @@ static void add_cell_candidate(struct cell_candidate_list *cl, UnitCell *cnew, } - if ( cl->n_cand >= MAX_CELL_CANDIDATES ) { + if ( cl->n_cand >= MAX_REAX_CELL_CANDIDATES ) { /* "cshift" just fell off the end of the list */ } else { cl->cand[cl->n_cand++] = cshift; @@ -953,7 +956,8 @@ static void assemble_cells_from_candidates(struct image *image, signed int ti, tj, tk; struct cell_candidate_list cl; - cl.cand = calloc(MAX_CELL_CANDIDATES, sizeof(struct cell_candidate)); + cl.cand = calloc(MAX_REAX_CELL_CANDIDATES, + sizeof(struct cell_candidate)); if ( cl.cand == NULL ) { ERROR("Failed to allocate cell candidate list.\n"); return; -- cgit v1.2.3