aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/stream.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2017-03-03 17:37:10 +0100
committerThomas White <taw@physics.org>2017-03-08 16:53:19 +0100
commit61565336125a999790fb4c36219e9c46c5eb30cc (patch)
treea4762229bad75ecf7679ac5f76162b20d7b0cd66 /libcrystfel/src/stream.c
parent10c3e04dda4264add6e99cb4763c9dbb31c771c9 (diff)
Allow indexing system to store its own data, independently of indexing methods
Previously, the indexing system passed all the information on to the indexing engines and then forgot about it. That made it difficult to do things like check the indexing solution after prediction refinement, because the target unit cell was unavailable. Now, the indexing system itself can keep some information. Of course, that information includes the private pointers for the indexing engines themselves. I took the opportunity to streamline things a little bit. The caller can now set up the indexing system in one step, without having to separately parse the names of the indexing methods. The caller no longer has to keep track of a separate array of methods, instead just one structure which contains everything.
Diffstat (limited to 'libcrystfel/src/stream.c')
-rw-r--r--libcrystfel/src/stream.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/libcrystfel/src/stream.c b/libcrystfel/src/stream.c
index e858172e..17da74b2 100644
--- a/libcrystfel/src/stream.c
+++ b/libcrystfel/src/stream.c
@@ -1196,13 +1196,9 @@ int read_chunk_2(Stream *st, struct image *image, StreamReadFlags srf)
}
if ( strncmp(line, "indexed_by = ", 13) == 0 ) {
- IndexingMethod *list;
- list = build_indexer_list(line+13);
- if ( list == NULL ) {
+ image->indexed_by = get_indm_from_string(line+13);
+ if ( image->indexed_by == INDEXING_ERROR ) {
ERROR("Failed to read indexer list\n");
- } else {
- image->indexed_by = list[0];
- free(list);
}
}