diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/index.c | 14 | ||||
-rw-r--r-- | src/index.h | 3 | ||||
-rw-r--r-- | src/reax.c | 60 | ||||
-rw-r--r-- | src/reax.h | 27 |
4 files changed, 103 insertions, 1 deletions
diff --git a/src/index.c b/src/index.c index 2fa7f58d..f0845c3a 100644 --- a/src/index.c +++ b/src/index.c @@ -29,10 +29,11 @@ #include "detector.h" #include "index.h" #include "index-priv.h" +#include "reax.h" /* Base class constructor for unspecialised indexing private data */ -static IndexingPrivate *indexing_private(IndexingMethod indm) +IndexingPrivate *indexing_private(IndexingMethod indm) { struct _indexingprivate *priv; priv = calloc(1, sizeof(struct _indexingprivate)); @@ -65,6 +66,9 @@ IndexingPrivate **prepare_indexing(IndexingMethod *indm, UnitCell *cell, case INDEXING_MOSFLM : iprivs[n] = indexing_private(indm[n]); break; + case INDEXING_REAX : + iprivs[n] = reax_prepare(); + break; } } @@ -92,6 +96,9 @@ void cleanup_indexing(IndexingPrivate **priv) case INDEXING_MOSFLM : free(priv[n]); break; + case INDEXING_REAX : + free(priv[n]); + break; } n++; @@ -145,6 +152,9 @@ void index_pattern(struct image *image, UnitCell *cell, IndexingMethod *indm, case INDEXING_MOSFLM : run_mosflm(image, cell); break; + case INDEXING_REAX : + reax_index(image, cell); + break; } if ( image->ncells == 0 ) { n++; @@ -229,6 +239,8 @@ IndexingMethod *build_indexer_list(const char *str, int *need_cell) list[i] = INDEXING_DIRAX; } else if ( strcmp(methods[i], "mosflm") == 0) { list[i] = INDEXING_MOSFLM; + } else if ( strcmp(methods[i], "reax") == 0) { + list[i] = INDEXING_REAX; } else { ERROR("Unrecognised indexing method '%s'\n", methods[i]); diff --git a/src/index.h b/src/index.h index 03e246f4..9d4b69bd 100644 --- a/src/index.h +++ b/src/index.h @@ -28,6 +28,7 @@ typedef enum { INDEXING_NONE, INDEXING_DIRAX, INDEXING_MOSFLM, + INDEXING_REAX, } IndexingMethod; @@ -42,6 +43,8 @@ enum { typedef struct _indexingprivate IndexingPrivate; +extern IndexingPrivate *indexing_private(IndexingMethod indm); + extern IndexingPrivate **prepare_indexing(IndexingMethod *indm, UnitCell *cell, const char *filename, struct detector *det, diff --git a/src/reax.c b/src/reax.c new file mode 100644 index 00000000..44dc52a6 --- /dev/null +++ b/src/reax.c @@ -0,0 +1,60 @@ +/* + * reax.c + * + * A new auto-indexer + * + * (c) 2011 Thomas White <taw@physics.org> + * + * Part of CrystFEL - crystallography with a FEL + * + */ + + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + + +#include <stdlib.h> +#include <stdio.h> +#include <math.h> + +#include "image.h" +#include "utils.h" +#include "peaks.h" +#include "cell.h" +#include "index.h" +#include "index-priv.h" + + +struct dvec +{ + double x; + double y; + double z; +}; + + +struct reax_private +{ + IndexingPrivate base; +}; + + +IndexingPrivate *reax_prepare() +{ + struct reax_private *priv; + + priv = calloc(1, sizeof(*priv)); + if ( priv == NULL ) return NULL; + + priv->base.indm = INDEXING_REAX; + + return (IndexingPrivate *)priv; +} + + +void reax_index(struct image *image, UnitCell *cell) +{ + +} diff --git a/src/reax.h b/src/reax.h new file mode 100644 index 00000000..8af6d3dc --- /dev/null +++ b/src/reax.h @@ -0,0 +1,27 @@ +/* + * reax.h + * + * A new auto-indexer + * + * (c) 2011 Thomas White <taw@physics.org> + * + * Part of CrystFEL - crystallography with a FEL + * + */ + + +#ifndef REAX_H +#define REAX_H + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include "cell.h" + +extern IndexingPrivate *reax_prepare(void); + +extern void reax_index(struct image *image, UnitCell *cell); + + +#endif /* REAX_H */ |