aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPascal Hogan-Lamarre <pascal.hogan@gmail.com>2020-09-16 02:45:55 -0400
committerPascal Hogan-Lamarre <pascal.hogan@gmail.com>2020-09-16 02:45:55 -0400
commit689d86d0937332aa8577329d007b0dd31a2b73c4 (patch)
tree008ac07fc1d766c1c3387680ca8ab3c6f16024f4
parentb11033a649afff30254804d9035ee9ccb67f044d (diff)
cleaning, remove double statements
-rw-r--r--libcrystfel/src/fromfile.c21
-rw-r--r--libcrystfel/src/fromfile.h32
2 files changed, 13 insertions, 40 deletions
diff --git a/libcrystfel/src/fromfile.c b/libcrystfel/src/fromfile.c
index 8dcb92c1..eff997b5 100644
--- a/libcrystfel/src/fromfile.c
+++ b/libcrystfel/src/fromfile.c
@@ -45,13 +45,7 @@
#define NPARAMS_PER_LINE 13
/* The keys are the filename,
* event path, event dim and crystal number */
-#define NKEYS_PER_LINE 4
-
-struct fromfile_private
-{
- UnitCell *cellTemplate;
- struct fromfile_entries *sol_hash;
-};
+#define NKEYS_PER_LINE 4
struct fromfile_keys
{
@@ -68,6 +62,12 @@ struct fromfile_entries
UT_hash_handle hh;
};
+struct fromfile_private
+{
+ UnitCell *cellTemplate;
+ struct fromfile_entries *sol_hash;
+};
+
void print_struct(struct fromfile_entries *sol_hash)
{
struct fromfile_entries *s;
@@ -328,18 +328,18 @@ int fromfile_index(struct image *image, void *mpriv, int crystal_number)
profile_radius = sol[11] * 1e9;
resolution_limit = sol[12] * 1e9;
- cr = crystal_new();
cell = cell_new();
cell_set_reciprocal(cell, asx, asy, asz, bsx, bsy, bsz, csx, csy, csz);
cell_set_lattice_type(cell, cell_get_lattice_type(dp->cellTemplate));
cell_set_centering(cell, cell_get_centering(dp->cellTemplate));
cell_set_unique_axis(cell, cell_get_unique_axis(dp->cellTemplate));
+ cr = crystal_new();
crystal_set_cell(cr, cell);
- crystal_set_det_shift(cr, xshift , yshift);
- update_detector(image->det, xshift , yshift);
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);
/*Look for additional crystals*/
@@ -348,7 +348,6 @@ int fromfile_index(struct image *image, void *mpriv, int crystal_number)
sizeof(struct fromfile_keys), pprime);
if ( pprime == NULL ) {
-
/* If no more crystal, done */
return 1;
}
diff --git a/libcrystfel/src/fromfile.h b/libcrystfel/src/fromfile.h
index dda976b5..29d31aee 100644
--- a/libcrystfel/src/fromfile.h
+++ b/libcrystfel/src/fromfile.h
@@ -27,40 +27,14 @@
#ifndef FROMFILE_H
#define FROMFILE_H
+struct fromfile_keys;
+struct fromfile_entries;
+struct fromfile_private;
#include "image.h"
#include "cell.h"
#include "uthash.h"
-/* There are 9 vector components,
- * 2 detector shifts, 1 profile radius,
- * 1 resolution limit */
-#define NPARAMS_PER_LINE 13
-/* The keys are the filename,
- * event path, event dim and crystal number */
-#define NKEYS_PER_LINE 4
-
-struct fromfile_private
-{
- UnitCell *cellTemplate;
- struct fromfile_entries *sol_hash;
-};
-
-struct fromfile_keys
-{
- char filename[100];
- char event_path[100];
- int event_dim;
- int crystal_number;
-};
-
-struct fromfile_entries
-{
- struct fromfile_keys key;
- float solution[NPARAMS_PER_LINE];
- UT_hash_handle hh;
-};
-
extern void print_struct(struct fromfile_entries *sol_hash);
extern void full_print_struct(struct fromfile_entries *sol_hash);