aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-02-03 12:25:19 +0100
committerThomas White <taw@physics.org>2010-02-03 12:25:19 +0100
commit2050e855c7dd5f9df6bb955b4dd00c92ede1721a (patch)
tree7c0d56160b10fc2d648d3e92d83e74330bc7dd92
parent1ac7acb915aef706b32cd2df133eee07cf9161bf (diff)
Count a hit only when the pattern can be indexed
-rw-r--r--src/index.c6
-rw-r--r--src/indexamajig.c4
2 files changed, 4 insertions, 6 deletions
diff --git a/src/index.c b/src/index.c
index 6d896820..2e0fd027 100644
--- a/src/index.c
+++ b/src/index.c
@@ -134,8 +134,6 @@ void index_pattern(struct image *image, IndexingMethod indm)
new_cell = match_cell(image->indexed_cell,
image->molecule->cell);
- if ( new_cell != NULL ) {
- free(image->indexed_cell);
- image->indexed_cell = new_cell;
- }
+ free(image->indexed_cell);
+ image->indexed_cell = new_cell;
}
diff --git a/src/indexamajig.c b/src/indexamajig.c
index d59132c5..c7108fee 100644
--- a/src/indexamajig.c
+++ b/src/indexamajig.c
@@ -180,8 +180,6 @@ int main(int argc, char *argv[])
if ( image_feature_count(image.features) > 5 ) {
- n_hits++;
-
if ( config_dumpfound ) dump_peaks(&image);
/* Not indexing nor writing xfel.drx?
@@ -198,6 +196,8 @@ int main(int argc, char *argv[])
/* No cell at this point? Then we're done. */
if ( image.indexed_cell == NULL ) goto done;
+ n_hits++;
+
/* Simulation or intensity measurements both require
* Ewald sphere vectors */
if ( config_nearbragg || config_simulate ) {