diff options
author | Thomas White <taw@physics.org> | 2017-09-15 15:46:37 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2017-09-15 15:46:37 +0200 |
commit | 5ca956f67456831501cf413259790eec6d6c6c1f (patch) | |
tree | 7ae69fb902f78af2828d4bbd4609a934c0a09dc7 /libcrystfel/src/asdf.c | |
parent | f6de9f595620b5d4a1ecf3d8d6d4cde9b3c179e0 (diff) | |
parent | ca0d7a9e1982b55ae3891d8dbe7f05a79ed3e7f1 (diff) |
Merge branch 'tom/index'
Diffstat (limited to 'libcrystfel/src/asdf.c')
-rw-r--r-- | libcrystfel/src/asdf.c | 42 |
1 files changed, 2 insertions, 40 deletions
diff --git a/libcrystfel/src/asdf.c b/libcrystfel/src/asdf.c index 0c43fe7a..bbfd1a56 100644 --- a/libcrystfel/src/asdf.c +++ b/libcrystfel/src/asdf.c @@ -272,39 +272,14 @@ static int calc_reciprocal(gsl_vector **direct, gsl_vector **reciprocal) static int check_cell(struct asdf_private *dp, struct image *image, UnitCell *cell) { - UnitCell *out; Crystal *cr; - if ( dp->indm & INDEXING_CHECK_CELL_COMBINATIONS ) { - - out = match_cell(cell, dp->template, 0, dp->ltl, 1); - if ( out == NULL ) return 0; - - } else if ( dp->indm & INDEXING_CHECK_CELL_AXES ) { - - out = match_cell(cell, dp->template, 0, dp->ltl, 0); - if ( out == NULL ) return 0; - - } else { - out = cell_new_from_cell(cell); - } - cr = crystal_new(); if ( cr == NULL ) { ERROR("Failed to allocate crystal.\n"); return 0; } - - crystal_set_cell(cr, out); - - if ( dp->indm & INDEXING_CHECK_PEAKS ) { - if ( !peak_sanity_check(image, &cr, 1) ) { - crystal_free(cr); /* Frees the cell as well */ - cell_free(out); - return 0; - } - } - + crystal_set_cell(cr, cell); image_add_crystal(image, cr); return 1; @@ -1206,22 +1181,9 @@ void *asdf_prepare(IndexingMethod *indm, UnitCell *cell, struct detector *det, float *ltl) { struct asdf_private *dp; - int need_cell = 0; - - if ( *indm & INDEXING_CHECK_CELL_COMBINATIONS ) need_cell = 1; - if ( *indm & INDEXING_CHECK_CELL_AXES ) need_cell = 1; - - if ( need_cell && !cell_has_parameters(cell) ) { - ERROR("Altering your asdf flags because cell parameters were" - " not provided.\n"); - *indm &= ~INDEXING_CHECK_CELL_COMBINATIONS; - *indm &= ~INDEXING_CHECK_CELL_AXES; - } /* Flags that asdf knows about */ - *indm &= INDEXING_METHOD_MASK | INDEXING_CHECK_CELL_COMBINATIONS - | INDEXING_CHECK_CELL_AXES | INDEXING_CHECK_PEAKS - | INDEXING_CONTROL_FLAGS; + *indm &= INDEXING_METHOD_MASK; dp = malloc(sizeof(struct asdf_private)); if ( dp == NULL ) return NULL; |