aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/man/indexamajig.16
-rw-r--r--libcrystfel/src/indexers/pinkindexer.c115
-rw-r--r--src/indexamajig.c4
3 files changed, 48 insertions, 77 deletions
diff --git a/doc/man/indexamajig.1 b/doc/man/indexamajig.1
index a912e19a..66bb51ad 100644
--- a/doc/man/indexamajig.1
+++ b/doc/man/indexamajig.1
@@ -446,9 +446,7 @@ These set low-level parameters for the XGANDALF indexing algorithm.
.IP \fB--pinkIndexer-tolerance=\fIn\fR
.IP \fB--pinkIndexer-reflection-radius=\fIn\fR
.IP \fB--pinkIndexer-max-resolution-for-indexing=\fIn\fR
-.IP \fB--pinkIndexer-multi\fR
.IP \fB--pinkIndexer-thread-count=\fIn\fR
-.IP \fB--pinkIndexer-no-check-indexed\fR
.IP \fB--pinkIndexer-max-refinement-disbalance=\fIn\fR
.IP \fB--pinkIndexer-override-bandwidth=\fIn\fR
.IP \fB--pinkIndexer-override-visible-energy-range=\fImin-max\fR
@@ -468,12 +466,8 @@ These set low-level parameters for the PinkIndexer indexing algorithm.
.IP
\fB--pinkIndexer-max-resolution-for-indexing\fR sets the maximum resolition in 1/A used for indexing. Peaks at high resolution don't add much information, but they add a lot of computation time. Default is infinity. Does not influence the refinement.
.IP
-\fB--pinkIndexer-multi\fR Use pinkIndexers own multi indexing. Should be combined with the --no-multi flag.
-.IP
\fB--pinkIndexer-thread-count\fR sets the thread count for internal parallelization. Default is 1. Very useful for small datasets (e.g. for screening). Internal parallelization does not significantly increase the amount of RAM needed, whereas CrystFEL's parallelization does. For HPCs typically a mixture of both parallelizations leads to best results.
.IP
-\fB--pinkIndexer-no-check-indexed\fR Leave the check whether a pattern is indexed completely to CrystFEL. Useful for monochromatic (since CrystFEL's prediction model is smarter than the one of pinkIndexer) or in combnation with --no-check-peaks for geometry optimization. This flag is meant to eventually disappear, when the full pink pipeline is implemented.
-.IP
\fB--pinkIndexer-max-refinement-disbalance Indexing solutions are dismissed if the refinement refined very well to one side of the detector and very badly to the other side. Allowed values range from 0 (no disbalance) to 2 (extreme disbalance), default 0.4. Disbalance after refinement usually appears for bad geometries or bad prior unit cell parameters.
.IP
\fB--pinkIndexer-override-bandwidth=\fIn\fR Overrides the bandwidth in (delta energy)/(mean energy) to use for indexing (which usually is defined in the geometry file). Should be used together with \fB--pinkIndexer-override-photon-energy=\fIn\fR. Note: this option sets the borders for the spectrum, whereas the option in the geometry file sets the standard deviation for a Gaussian that fits the spectrum. Internally, the standard deviation is multiplied by 5 to compute the hard borders of the spectrum. I.e., photon_energy_bandwith = 0.005 in the geometry file equals --pinkIndexer-override-bandwidth=0.025. For monochromatic experiments usually --pinkIndexer-override-bandwidth=0.02 is sufficiently large. If in doubt, use --pinkIndexer-override-visible-energy-range.
diff --git a/libcrystfel/src/indexers/pinkindexer.c b/libcrystfel/src/indexers/pinkindexer.c
index 6d98d3c0..6f95dd9b 100644
--- a/libcrystfel/src/indexers/pinkindexer.c
+++ b/libcrystfel/src/indexers/pinkindexer.c
@@ -48,10 +48,7 @@ struct pinkIndexer_options {
unsigned int refinement_type;
float maxResolutionForIndexing_1_per_A;
float tolerance;
- int multi;
int thread_count;
- int min_peaks;
- int no_check_indexed;
float reflectionRadius; /* In m^-1 */
float customBandwidth;
float maxRefinementDisbalance;
@@ -63,8 +60,6 @@ struct pinkIndexer_options {
#include <pinkIndexer/adaptions/crystfel/ExperimentSettings.h>
#include <pinkIndexer/adaptions/crystfel/PinkIndexer.h>
-#define MAX_MULTI_LATTICE_COUNT 8
-
struct pinkIndexer_private_data {
PinkIndexer *pinkIndexer;
reciprocalPeaks_1_per_A_t reciprocalPeaks_1_per_A;
@@ -73,10 +68,6 @@ struct pinkIndexer_private_data {
IndexingMethod indm;
UnitCell *cellTemplate;
int threadCount;
- int multi;
- int min_peaks;
-
- int no_check_indexed;
float maxRefinementDisbalance;
@@ -121,71 +112,71 @@ int run_pinkIndexer(struct image *image, void *ipriv)
reciprocalPeaks_1_per_A->peakCount++;
}
int indexed = 0;
- Lattice_t indexedLattice[MAX_MULTI_LATTICE_COUNT];
- float center_shift[MAX_MULTI_LATTICE_COUNT][2];
-
+ float center_shift[2];
+ Lattice_t indexedLattice;
+ int matchedPeaksCount = PinkIndexer_indexPattern(pinkIndexer_private_data->pinkIndexer,
+ &indexedLattice,
+ center_shift,
+ reciprocalPeaks_1_per_A,
+ intensities,
+ pinkIndexer_private_data->maxRefinementDisbalance,
+ pinkIndexer_private_data->threadCount);
- do {
- int peakCount = reciprocalPeaks_1_per_A->peakCount;
- int matchedPeaksCount = PinkIndexer_indexPattern(pinkIndexer_private_data->pinkIndexer,
- &(indexedLattice[indexed]), center_shift[indexed], reciprocalPeaks_1_per_A, intensities,
- pinkIndexer_private_data->maxRefinementDisbalance,
- pinkIndexer_private_data->threadCount);
+ if ( matchedPeaksCount == -1 ) {
- if(matchedPeaksCount == -1){
- STATUS("WARNING: Indexing solution was rejected due to too large disbalance of the refinement."
- "If you see this message often, check the documentation for the parameter "
- "--pinkIndexer-max-refinement-disbalance\n");
+ STATUS("WARNING: Indexing solution was rejected due to too "
+ "large imbalance of the refinement.\n"
+ "If you see this message often, check the documentation "
+ "for parameter --pinkIndexer-max-refinement-disbalance\n");
- matchedPeaksCount = 0;
- }
+ } else {
- printf("matchedPeaksCount %d from %d\n",matchedPeaksCount,peakCount);
- if ((matchedPeaksCount >= 25 && matchedPeaksCount >= peakCount * 0.30)
- || matchedPeaksCount >= peakCount * 0.4
- || matchedPeaksCount >= 70
- || pinkIndexer_private_data->no_check_indexed == 1)
- {
- UnitCell *uc;
- uc = cell_new();
+ UnitCell *uc;
+ UnitCell *new_cell_trans;
- Lattice_t *l = &(indexedLattice[indexed]);
+ uc = cell_new();
- cell_set_reciprocal(uc, l->ay * 1e10, l->az * 1e10, l->ax * 1e10,
- l->by * 1e10, l->bz * 1e10, l->bx * 1e10,
- l->cy * 1e10, l->cz * 1e10, l->cx * 1e10);
+ cell_set_reciprocal(uc, indexedLattice.ay * 1e10,
+ indexedLattice.az * 1e10,
+ indexedLattice.ax * 1e10,
+ indexedLattice.by * 1e10,
+ indexedLattice.bz * 1e10,
+ indexedLattice.bx * 1e10,
+ indexedLattice.cy * 1e10,
+ indexedLattice.cz * 1e10,
+ indexedLattice.cx * 1e10);
- restoreReciprocalCell(uc, &pinkIndexer_private_data->latticeReductionTransform);
+ restoreReciprocalCell(uc, &pinkIndexer_private_data->latticeReductionTransform);
- UnitCell *new_cell_trans = cell_transform_intmat(uc, pinkIndexer_private_data->centeringTransformation);
- cell_free(uc);
- uc = new_cell_trans;
+ new_cell_trans = cell_transform_intmat(uc, pinkIndexer_private_data->centeringTransformation);
+ cell_free(uc);
- cell_set_lattice_type(new_cell_trans, cell_get_lattice_type(pinkIndexer_private_data->cellTemplate));
- cell_set_centering(new_cell_trans, cell_get_centering(pinkIndexer_private_data->cellTemplate));
- cell_set_unique_axis(new_cell_trans, cell_get_unique_axis(pinkIndexer_private_data->cellTemplate));
+ cell_set_lattice_type(new_cell_trans,
+ cell_get_lattice_type(pinkIndexer_private_data->cellTemplate));
+ cell_set_centering(new_cell_trans,
+ cell_get_centering(pinkIndexer_private_data->cellTemplate));
+ cell_set_unique_axis(new_cell_trans,
+ cell_get_unique_axis(pinkIndexer_private_data->cellTemplate));
- if (validate_cell(uc)) {
- ERROR("pinkIndexer: problem with returned cell!\n");
- }
+ if ( validate_cell(new_cell_trans) ) {
+ ERROR("pinkIndexer: problem with returned cell!\n");
+ } else {
- Crystal * cr = crystal_new();
- if (cr == NULL) {
+ Crystal *cr = crystal_new();
+ if ( cr == NULL ) {
ERROR("Failed to allocate crystal.\n");
return 0;
}
- crystal_set_cell(cr, uc);
- crystal_set_det_shift(cr, center_shift[indexed][0], center_shift[indexed][1]);
+ crystal_set_cell(cr, new_cell_trans);
+ crystal_set_det_shift(cr, center_shift[0],
+ center_shift[1]);
image_add_crystal(image, cr);
indexed++;
- } else {
- break;
}
- } while (pinkIndexer_private_data->multi
- && indexed <= MAX_MULTI_LATTICE_COUNT
- && reciprocalPeaks_1_per_A->peakCount >= pinkIndexer_private_data->min_peaks);
+
+ }
return indexed;
}
@@ -237,9 +228,6 @@ void *pinkIndexer_prepare(IndexingMethod *indm,
pinkIndexer_private_data->indm = *indm;
pinkIndexer_private_data->cellTemplate = cell;
pinkIndexer_private_data->threadCount = pinkIndexer_opts->thread_count;
- pinkIndexer_private_data->multi = pinkIndexer_opts->multi;
- pinkIndexer_private_data->min_peaks = pinkIndexer_opts->min_peaks;
- pinkIndexer_private_data->no_check_indexed = pinkIndexer_opts->no_check_indexed;
pinkIndexer_private_data->maxRefinementDisbalance = pinkIndexer_opts->maxRefinementDisbalance;
UnitCell* primitiveCell = uncenter_cell(cell, &pinkIndexer_private_data->centeringTransformation, NULL);
@@ -454,13 +442,9 @@ static void pinkIndexer_show_help()
" Specified in 1/A. Default is 2%% of a*.\n"
" --pinkIndexer-max-resolution-for-indexing=n\n"
" Measured in 1/A\n"
-" --pinkIndexer-multi Use pinkIndexers own multi indexing.\n"
" --pinkIndexer-thread-count=n\n"
" Thread count for internal parallelization \n"
" Default: 1\n"
-" --pinkIndexer-no-check-indexed\n"
-" Disable internal check for correct indexing\n"
-" solutions\n"
" --pinkIndexer-max-refinement-disbalance=n\n"
" Maximum disbalance after refinement:\n"
" 0 (no disbalance) to 2 (extreme disbalance), default 0.4\n"
@@ -488,9 +472,6 @@ int pinkIndexer_default_options(PinkIndexerOptions **opts_ptr)
opts->tolerance = 0.06;
opts->maxResolutionForIndexing_1_per_A = +INFINITY;
opts->thread_count = 1;
- opts->multi = 0;
- opts->no_check_indexed = 0;
- opts->min_peaks = 2;
opts->reflectionRadius = -1;
opts->customBandwidth = -1;
opts->maxRefinementDisbalance = 0.4;
@@ -571,11 +552,11 @@ static error_t pinkindexer_parse_arg(int key, char *arg,
break;
case 8 :
- (*opts_ptr)->multi = 1;
+ ERROR("WARNING: --pinkIndexer-multi is ignored.\n");
break;
case 9 :
- (*opts_ptr)->no_check_indexed = 1;
+ ERROR("WARNING: --pinkIndexer-no-check-indexed is ignored.\n");
break;
case 10 :
diff --git a/src/indexamajig.c b/src/indexamajig.c
index 0d4ce2dc..8471e9cb 100644
--- a/src/indexamajig.c
+++ b/src/indexamajig.c
@@ -243,10 +243,6 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state)
ERROR("Invalid value for --min-peaks\n");
return EINVAL;
}
- /* FIXME: Horrible layering violation, needed for
- * pinkIndexer multi-lattice indexing but no longer
- * possible. */
- //(*(args->pinkindexer_opts_ptr))->min_peaks = args->iargs.min_peaks;
break;
case 304 :