aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-02-04 15:26:48 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:13 +0100
commit155ca0064e5605a345d141202d6cbf7dce9a220b (patch)
tree62544ea055ea0ca67d9c55f5fd6cc166b386fcab /src
parent59ae49baa64e841aaf3a5030b92fb3bce7d984e5 (diff)
indexamajig: Allow the user to switch off the sanity check if they want
Diffstat (limited to 'src')
-rw-r--r--src/index.c6
-rw-r--r--src/index.h2
-rw-r--r--src/indexamajig.c9
3 files changed, 13 insertions, 4 deletions
diff --git a/src/index.c b/src/index.c
index 57399c61..5675eb0f 100644
--- a/src/index.c
+++ b/src/index.c
@@ -129,7 +129,8 @@ void map_all_peaks(struct image *image)
void index_pattern(struct image *image, UnitCell *cell, IndexingMethod *indm,
- int cellr, int verbose, IndexingPrivate **ipriv)
+ int cellr, int verbose, IndexingPrivate **ipriv,
+ int config_insane)
{
int i;
int n = 0;
@@ -207,7 +208,8 @@ void index_pattern(struct image *image, UnitCell *cell, IndexingMethod *indm,
if ( new_cell == NULL ) continue;
/* Sanity check */
- if ( !peak_sanity_check(image, new_cell, 0, 0.1) ) {
+ if ( !config_insane &&
+ !peak_sanity_check(image, new_cell, 0, 0.1) ) {
STATUS("Failed peak sanity check.\n");
cell_free(new_cell);
continue;
diff --git a/src/index.h b/src/index.h
index b58c9b53..8f3e0ab7 100644
--- a/src/index.h
+++ b/src/index.h
@@ -51,7 +51,7 @@ extern void map_all_peaks(struct image *image);
extern void index_pattern(struct image *image, UnitCell *cell,
IndexingMethod *indm, int cellr, int verbose,
- IndexingPrivate **priv);
+ IndexingPrivate **priv, int config_insane);
extern void cleanup_indexing(IndexingPrivate **priv);
diff --git a/src/indexamajig.c b/src/indexamajig.c
index c997ed12..6c01f95e 100644
--- a/src/indexamajig.c
+++ b/src/indexamajig.c
@@ -62,6 +62,7 @@ struct static_index_args
int config_polar;
int config_satcorr;
int config_closer;
+ int config_insane;
float threshold;
float min_gradient;
struct detector *det;
@@ -197,6 +198,8 @@ static void show_help(const char *s)
" --no-closer-peak Don't integrate from the location of a nearby peak\n"
" instead of the position closest to the reciprocal\n"
" lattice point.\n"
+" --insane Don't check that the reduced cell accounts for at\n"
+" least 10%% of the located peaks.\n"
);
}
@@ -387,7 +390,8 @@ static void process_image(void *pp, int cookie)
/* Calculate orientation matrix (by magic) */
index_pattern(&image, cell, indm, pargs->static_args.cellr,
- config_verbose, pargs->static_args.ipriv);
+ config_verbose, pargs->static_args.ipriv,
+ pargs->static_args.config_insane);
/* No cell at this point? Then we're done. */
if ( image.indexed_cell == NULL ) goto done;
@@ -510,6 +514,7 @@ int main(int argc, char *argv[])
int config_satcorr = 1;
int config_checkprefix = 1;
int config_closer = 1;
+ int config_insane = 0;
float threshold = 800.0;
float min_gradient = 100000.0;
struct detector *det;
@@ -572,6 +577,7 @@ int main(int argc, char *argv[])
{"no-check-prefix", 0, &config_checkprefix, 0},
{"no-closer-peak", 0, &config_closer, 0},
{"gpu-dev", 1, NULL, 5},
+ {"insane", 1, &config_insane, 1},
{0, 0, NULL, 0}
};
@@ -862,6 +868,7 @@ int main(int argc, char *argv[])
qargs.static_args.config_polar = config_polar;
qargs.static_args.config_satcorr = config_satcorr;
qargs.static_args.config_closer = config_closer;
+ qargs.static_args.config_insane = config_insane;
qargs.static_args.cellr = cellr;
qargs.static_args.threshold = threshold;
qargs.static_args.min_gradient = min_gradient;