aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPascal Hogan-Lamarre <pascal.hogan@gmail.com>2020-10-04 20:57:30 -0400
committerPascal Hogan-Lamarre <pascal.hogan@gmail.com>2020-10-04 20:57:30 -0400
commitf937b91c7c9016665efd0c38af1e0a5d21d41c99 (patch)
tree31250097f756411a7ad96858047c7277db2ef9e1
parentabbba986d43b1fa9d7107101d7b5432d6796009b (diff)
Solved problem concerning prof_radius and diff_lim calculation, prof_radius and diff_lim removed from sol file
-rw-r--r--libcrystfel/src/fromfile.c10
-rw-r--r--libcrystfel/src/index.c28
-rw-r--r--libcrystfel/src/integration.c9
-rw-r--r--src/process_image.c10
4 files changed, 28 insertions, 29 deletions
diff --git a/libcrystfel/src/fromfile.c b/libcrystfel/src/fromfile.c
index 05262458..13044ebe 100644
--- a/libcrystfel/src/fromfile.c
+++ b/libcrystfel/src/fromfile.c
@@ -42,7 +42,7 @@
/* There are 9 vector components,
* 2 detector shifts, 1 profile radius,
* 1 resolution limit */
-#define NPARAMS_PER_LINE 13
+#define NPARAMS_PER_LINE 11
/* The keys read from file
* are the filename, event */
#define NKEYS_PER_LINE 2
@@ -326,7 +326,7 @@ int fromfile_index(struct image *image, void *mpriv, int crystal_number)
Crystal *cr;
UnitCell *cell;
float asx, asy, asz, bsx, bsy, bsz, csx, csy, csz;
- float xshift, yshift, profile_radius, resolution_limit;
+ float xshift, yshift;
struct fromfile_entries *item, *p, *pprime;
int ncryst = 0;
float *sol;
@@ -359,8 +359,6 @@ int fromfile_index(struct image *image, void *mpriv, int crystal_number)
csz = sol[8] * 1e9;
xshift = sol[9] * 1e-3;
yshift = sol[10] * 1e-3;
- profile_radius = sol[11] * 1e9;
- resolution_limit = sol[12] * 1e9;
cell = cell_new();
cell_set_reciprocal(cell, asx, asy, asz, bsx, bsy, bsz, csx, csy, csz);
@@ -371,8 +369,6 @@ int fromfile_index(struct image *image, void *mpriv, int crystal_number)
cr = crystal_new();
ncryst += 1;
crystal_set_cell(cr, cell);
- crystal_set_profile_radius(cr, profile_radius);
- crystal_set_resolution_limit(cr, resolution_limit);
crystal_set_det_shift(cr, xshift , yshift);
update_detector(image->det, xshift , yshift);
image_add_crystal(image, cr);
@@ -382,6 +378,8 @@ int fromfile_index(struct image *image, void *mpriv, int crystal_number)
HASH_FIND(hh, dp->sol_hash, &item->key,
sizeof(struct fromfile_keys), pprime);
+ /* If a similar tag exist,
+ * recursive call increasing the crystal_number by 1 */
if ( pprime != NULL ) {
ncryst += fromfile_index(image, mpriv, crystal_number+1);
}
diff --git a/libcrystfel/src/index.c b/libcrystfel/src/index.c
index e0e8ff05..7b03ba3e 100644
--- a/libcrystfel/src/index.c
+++ b/libcrystfel/src/index.c
@@ -664,9 +664,7 @@ static int try_indexer(struct image *image, IndexingMethod indm,
Crystal *cr = image->crystals[this_crystal];
crystal_set_image(cr, image);
- if ( indm != INDEXING_FILE){
- crystal_set_profile_radius(cr, 0.02e9);
- }
+ crystal_set_profile_radius(cr, 0.02e9);
crystal_set_mosaicity(cr, 0.0);
/* Pre-refinement unit cell check if requested */
@@ -877,12 +875,14 @@ void index_pattern_3(struct image *image, IndexingPrivate *ipriv, int *ping,
if ( ipriv == NULL ) return;
- map_all_peaks(image);
+ if ( ipriv->methods[0] != INDEXING_FILE){
+ map_all_peaks(image);
+ orig = image->features;
+ }
+
image->crystals = NULL;
image->n_crystals = 0;
- orig = image->features;
-
for ( n=0; n<ipriv->n_methods; n++ ) {
int done = 0;
@@ -890,7 +890,9 @@ void index_pattern_3(struct image *image, IndexingPrivate *ipriv, int *ping,
int ntry = 0;
int success = 0;
- image->features = sort_peaks(orig);
+ if ( ipriv->methods[0] != INDEXING_FILE){
+ image->features = sort_peaks(orig);
+ }
do {
@@ -906,7 +908,9 @@ void index_pattern_3(struct image *image, IndexingPrivate *ipriv, int *ping,
} while ( !done );
- image_feature_list_free(image->features);
+ if ( ipriv->methods[0] != INDEXING_FILE){
+ image_feature_list_free(image->features);
+ }
/* Stop now if the pattern is indexed (don't try again for more
* crystals with a different indexing method) */
@@ -917,13 +921,19 @@ void index_pattern_3(struct image *image, IndexingPrivate *ipriv, int *ping,
}
+ if ( ipriv->methods[0] == INDEXING_FILE){
+ map_all_peaks(image);
+ }
+ else{
+ image->features = orig;
+ }
+
if ( n < ipriv->n_methods ) {
image->indexed_by = ipriv->methods[n];
} else {
image->indexed_by = INDEXING_NONE;
}
- image->features = orig;
}
diff --git a/libcrystfel/src/integration.c b/libcrystfel/src/integration.c
index 8a3c581e..3d8258c1 100644
--- a/libcrystfel/src/integration.c
+++ b/libcrystfel/src/integration.c
@@ -1687,14 +1687,9 @@ void integrate_all_5(struct image *image, IntegrationMethod meth,
saved_R * 5);
}
- if ( image->indexed_by != INDEXING_FILE ){
- res = estimate_resolution(crystal_get_cell(image->crystals[i]),
+ res = estimate_resolution(crystal_get_cell(image->crystals[i]),
image->features);
- crystal_set_resolution_limit(image->crystals[i], res);
- }
- else{
- res = crystal_get_resolution_limit(image->crystals[i]);
- }
+ crystal_set_resolution_limit(image->crystals[i], res);
list = predict_to_res(image->crystals[i], res+push_res);
crystal_set_reflections(image->crystals[i], list);
diff --git a/src/process_image.c b/src/process_image.c
index 003886c4..b785705a 100644
--- a/src/process_image.c
+++ b/src/process_image.c
@@ -430,9 +430,7 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs,
}
} else {
for ( i=0; i<image.n_crystals; i++ ) {
- if ( image.indexed_by != INDEXING_FILE){
- crystal_set_profile_radius(image.crystals[i], 0.02e9);
- }
+ crystal_set_profile_radius(image.crystals[i], 0.02e9);
crystal_set_mosaicity(image.crystals[i], 0.0);
}
}
@@ -440,10 +438,8 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs,
if ( iargs->fix_profile_r < 0.0 ) {
for ( i=0; i<image.n_crystals; i++ ) {
- if ( image.indexed_by != INDEXING_FILE){
- if ( refine_radius(image.crystals[i], &image) ) {
- ERROR("WARNING: Radius determination failed\n");
- }
+ if ( refine_radius(image.crystals[i], &image) ) {
+ ERROR("WARNING: Radius determination failed\n");
}
}
}