aboutsummaryrefslogtreecommitdiff
path: root/src/indexamajig.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-05-26 18:51:23 +0200
committerThomas White <taw@physics.org>2010-05-26 18:51:23 +0200
commit8941c1ba4ba4bc4ed00b41db371fb9d75ac137ca (patch)
tree6e33386eee5bd51ec52dd533e8af26234b48d277 /src/indexamajig.c
parent2ea2488a3752ccb12bae10ae5bf8446f2f3f99f3 (diff)
Add peak sanity check
Diffstat (limited to 'src/indexamajig.c')
-rw-r--r--src/indexamajig.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/indexamajig.c b/src/indexamajig.c
index c21dc22f..db433369 100644
--- a/src/indexamajig.c
+++ b/src/indexamajig.c
@@ -67,6 +67,7 @@ struct process_args
struct process_result
{
int hit;
+ int peaks_sane;
};
@@ -194,6 +195,10 @@ static struct image *get_simage(struct image *template, int alternate)
image->indexed_cell = template->indexed_cell;
image->f0 = template->f0;
+ /* Prevent muppetry */
+ image->hits = NULL;
+ image->n_hits = 0;
+
return image;
}
@@ -252,6 +257,8 @@ static void *process_image(void *pargsv)
image.indexed_cell = NULL;
image.id = pargs->id;
image.filename = filename;
+ image.hits = NULL;
+ image.n_hits = 0;
STATUS("Processing '%s'\n", image.filename);
@@ -318,6 +325,15 @@ static void *process_image(void *pargsv)
/* No cell at this point? Then we're done. */
if ( image.indexed_cell == NULL ) goto done;
+ /* Sanity check */
+ if ( !peak_sanity_check(&image, image.indexed_cell) ) {
+ STATUS("Failed peak sanity check.\n");
+ result->peaks_sane = 0;
+ goto done;
+ } else {
+ result->peaks_sane = 1;
+ }
+
/* Measure intensities if requested */
if ( config_nearbragg ) {
/* Use original data (temporarily) */