aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-02-04 19:18:16 +0100
committerThomas White <taw@physics.org>2010-02-04 19:18:16 +0100
commit96046b5dbb09328b4dac40f363cd8157cf32b4fa (patch)
tree07f36be3f6437888c972002580a9ebcfa042b375
parent187ba88a5fc87f65f19fcaa80a002d9ca9e43bbb (diff)
Add --no-match option to skip the unit cell matching procedure
-rw-r--r--src/index.c12
-rw-r--r--src/index.h3
-rw-r--r--src/indexamajig.c7
3 files changed, 15 insertions, 7 deletions
diff --git a/src/index.c b/src/index.c
index 4bc74b82..27d75554 100644
--- a/src/index.c
+++ b/src/index.c
@@ -102,7 +102,7 @@ static void write_drx(struct image *image)
}
-void index_pattern(struct image *image, IndexingMethod indm)
+void index_pattern(struct image *image, IndexingMethod indm, int no_match)
{
int i;
UnitCell *new_cell = NULL;
@@ -148,8 +148,10 @@ void index_pattern(struct image *image, IndexingMethod indm)
return;
}
- new_cell = match_cell(image->indexed_cell,
- image->molecule->cell);
- free(image->indexed_cell);
- image->indexed_cell = new_cell;
+ if ( !no_match ) {
+ new_cell = match_cell(image->indexed_cell,
+ image->molecule->cell);
+ free(image->indexed_cell);
+ image->indexed_cell = new_cell;
+ }
}
diff --git a/src/index.h b/src/index.h
index a3dae020..08ffa2fc 100644
--- a/src/index.h
+++ b/src/index.h
@@ -25,7 +25,8 @@ typedef enum {
} IndexingMethod;
-extern void index_pattern(struct image *image, IndexingMethod indm);
+extern void index_pattern(struct image *image, IndexingMethod indm,
+ int no_match);
/* x,y in pixels relative to central beam */
extern int map_position(struct image *image, double x, double y,
double *rx, double *ry, double *rz);
diff --git a/src/indexamajig.c b/src/indexamajig.c
index 6b0ad3d9..3f75f8b0 100644
--- a/src/indexamajig.c
+++ b/src/indexamajig.c
@@ -56,6 +56,9 @@ static void show_help(const char *s)
" unit cell.\n"
" --clean-image Perform common-mode noise subtraction and\n"
" background removal on images before proceeding.\n"
+" --no-match Don't attempt to match the indexed cell to the\n"
+" model, just proceed with the one generated by the\n"
+" auto-indexing procedure.\n"
"\n");
}
@@ -74,6 +77,7 @@ int main(int argc, char *argv[])
int config_writedrx = 0;
int config_simulate = 0;
int config_clean = 0;
+ int config_nomatch = 0;
IndexingMethod indm;
char *indm_str = NULL;
@@ -88,6 +92,7 @@ int main(int argc, char *argv[])
{"indexing", 1, NULL, 'z'},
{"simulate", 0, &config_simulate, 1},
{"clean-image", 0, &config_clean, 1},
+ {"no-match", 0, &config_nomatch, 1},
{0, 0, NULL, 0}
};
@@ -217,7 +222,7 @@ int main(int argc, char *argv[])
/* Calculate orientation matrix (by magic) */
if ( config_writedrx || (indm != INDEXING_NONE) ) {
- index_pattern(&image, indm);
+ index_pattern(&image, indm, config_nomatch);
}
/* No cell at this point? Then we're done. */