From 761da16096472d157b2dd9c871e81ab17cdef12d Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 6 Feb 2013 18:59:40 +0100 Subject: Stuff for partialator --- libcrystfel/src/crystal.c | 42 ++++++++++++++++++++++++++++++++++++++++++ libcrystfel/src/crystal.h | 2 ++ libcrystfel/src/geometry.c | 3 ++- libcrystfel/src/geometry.h | 2 +- 4 files changed, 47 insertions(+), 2 deletions(-) (limited to 'libcrystfel') diff --git a/libcrystfel/src/crystal.c b/libcrystfel/src/crystal.c index 8ba955f6..6ff251e0 100644 --- a/libcrystfel/src/crystal.c +++ b/libcrystfel/src/crystal.c @@ -49,6 +49,9 @@ struct _crystal { + /* The image containing the crystal */ + struct image *image; + /* Information about the crystal */ UnitCell *cell; double m; /* Mosaicity in radians */ @@ -60,6 +63,9 @@ struct _crystal /* Integrated (or about-to-be-integrated) reflections */ RefList *reflections; long long int n_saturated; /* Number of overloads */ + + /* User flag, e.g. for "this is a bad crystal". */ + int user_flag; }; @@ -139,6 +145,24 @@ long long int crystal_get_num_saturated_reflections(Crystal *cryst) } +struct image *crystal_get_image(Crystal *cryst) +{ + return cryst->image; +} + + +double crystal_get_osf(Crystal *cryst) +{ + return cryst->osf; +} + + +int crystal_get_user_flag(Crystal *cryst) +{ + return cryst->user_flag; +} + + /********************************** Setters ***********************************/ @@ -172,3 +196,21 @@ void crystal_set_num_saturated_reflections(Crystal *cryst, long long int n) { cryst->n_saturated = n; } + + +void crystal_set_image(Crystal *cryst, struct image *image) +{ + cryst->image = image; +} + + +void crystal_set_osf(Crystal *cryst, double osf) +{ + cryst->osf = osf; +} + + +void crystal_set_user_flag(Crystal *cryst, int user_flag) +{ + cryst->user_flag = user_flag; +} diff --git a/libcrystfel/src/crystal.h b/libcrystfel/src/crystal.h index f418f23a..f7c49a81 100644 --- a/libcrystfel/src/crystal.h +++ b/libcrystfel/src/crystal.h @@ -57,6 +57,7 @@ extern double crystal_get_resolution_limit(Crystal *cryst); extern long long int crystal_get_num_saturated_reflections(Crystal *cryst); extern int crystal_get_user_flag(Crystal *cryst); extern double crystal_get_osf(Crystal *cryst); +extern struct image *crystal_get_image(Crystal *cryst); extern void crystal_set_cell(Crystal *cryst, UnitCell *cell); extern void crystal_set_profile_radius(Crystal *cryst, double r); @@ -66,5 +67,6 @@ extern void crystal_set_num_saturated_reflections(Crystal *cryst, long long int n); extern void crystal_set_user_flag(Crystal *cryst, int flag); extern void crystal_set_osf(Crystal *cryst, double osf); +extern void crystal_set_image(Crystal *cryst, struct image *image); #endif /* CRYSTAL_H */ diff --git a/libcrystfel/src/geometry.c b/libcrystfel/src/geometry.c index 9c494e2c..704baa51 100644 --- a/libcrystfel/src/geometry.c +++ b/libcrystfel/src/geometry.c @@ -346,7 +346,7 @@ RefList *select_intersections(struct image *image, Crystal *cryst) /* Calculate partialities and apply them to the image's reflections */ -void update_partialities(struct image *image, Crystal *cryst) +void update_partialities(Crystal *cryst) { Reflection *refl; RefListIterator *iter; @@ -354,6 +354,7 @@ void update_partialities(struct image *image, Crystal *cryst) double asx, asy, asz; double bsx, bsy, bsz; double csx, csy, csz; + struct image *image = crystal_get_image(cryst); cell_get_reciprocal(crystal_get_cell(cryst), &asx, &asy, &asz, &bsx, &bsy, &bsz, &csx, &csy, &csz); diff --git a/libcrystfel/src/geometry.h b/libcrystfel/src/geometry.h index 9d8fa475..aecdc28a 100644 --- a/libcrystfel/src/geometry.h +++ b/libcrystfel/src/geometry.h @@ -46,7 +46,7 @@ extern "C" { extern RefList *find_intersections(struct image *image, Crystal *cryst); extern RefList *select_intersections(struct image *image, Crystal *cryst); -extern void update_partialities(struct image *image, Crystal *cryst); +extern void update_partialities(Crystal *cryst); #ifdef __cplusplus } -- cgit v1.2.3