aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2014-11-09 06:23:27 +0100
committerThomas White <taw@physics.org>2014-11-09 06:23:27 +0100
commitecce96b99c98c2b5efadbf186d2085115dbc142a (patch)
tree4cf77532880d9a68a4bf3e48990d14867055e269 /libcrystfel/src
parent356733c418dacf19d3930e37e08ddcdc17311c3a (diff)
Record number of implausibly negative reflections in stream
Diffstat (limited to 'libcrystfel/src')
-rw-r--r--libcrystfel/src/crystal.c15
-rw-r--r--libcrystfel/src/crystal.h3
-rw-r--r--libcrystfel/src/integration.c1
-rw-r--r--libcrystfel/src/stream.c2
4 files changed, 21 insertions, 0 deletions
diff --git a/libcrystfel/src/crystal.c b/libcrystfel/src/crystal.c
index 02255110..c6e0a9dd 100644
--- a/libcrystfel/src/crystal.c
+++ b/libcrystfel/src/crystal.c
@@ -63,6 +63,8 @@ struct _crystal
/* Integrated (or about-to-be-integrated) reflections */
RefList *reflections;
long long int n_saturated; /* Number of overloads */
+ long long int n_implausible; /* Number of implausibly
+ * negative reflectionss */
/* User flag, e.g. for "this is a bad crystal". */
int user_flag;
@@ -91,6 +93,7 @@ Crystal *crystal_new()
cryst->reflections = NULL;
cryst->resolution_limit = 0.0;
cryst->n_saturated = 0;
+ cryst->n_implausible = 0;
return cryst;
}
@@ -167,6 +170,12 @@ long long int crystal_get_num_saturated_reflections(Crystal *cryst)
}
+long long int crystal_get_num_implausible_reflections(Crystal *cryst)
+{
+ return cryst->n_implausible;
+}
+
+
struct image *crystal_get_image(Crystal *cryst)
{
return cryst->image;
@@ -224,6 +233,12 @@ void crystal_set_num_saturated_reflections(Crystal *cryst, long long int n)
}
+void crystal_set_num_implausible_reflections(Crystal *cryst, long long int n)
+{
+ cryst->n_implausible = n;
+}
+
+
void crystal_set_image(Crystal *cryst, struct image *image)
{
cryst->image = image;
diff --git a/libcrystfel/src/crystal.h b/libcrystfel/src/crystal.h
index 11b85e35..987cabbf 100644
--- a/libcrystfel/src/crystal.h
+++ b/libcrystfel/src/crystal.h
@@ -59,6 +59,7 @@ extern double crystal_get_profile_radius(Crystal *cryst);
extern RefList *crystal_get_reflections(Crystal *cryst);
extern double crystal_get_resolution_limit(Crystal *cryst);
extern long long int crystal_get_num_saturated_reflections(Crystal *cryst);
+extern long long int crystal_get_num_implausible_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);
@@ -70,6 +71,8 @@ extern void crystal_set_reflections(Crystal *cryst, RefList *reflist);
extern void crystal_set_resolution_limit(Crystal *cryst, double res);
extern void crystal_set_num_saturated_reflections(Crystal *cryst,
long long int n);
+extern void crystal_set_num_implausible_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);
diff --git a/libcrystfel/src/integration.c b/libcrystfel/src/integration.c
index 8e175f5b..f352c0c6 100644
--- a/libcrystfel/src/integration.c
+++ b/libcrystfel/src/integration.c
@@ -1801,6 +1801,7 @@ static void integrate_rings(IntegrationMethod meth,
free_intcontext(&ic);
crystal_set_num_saturated_reflections(cr, ic.n_saturated);
+ crystal_set_num_implausible_reflections(cr, ic.n_implausible);
if ( ic.n_implausible ) {
STATUS("Warning: %i implausibly negative reflection%s in %s.\n",
diff --git a/libcrystfel/src/stream.c b/libcrystfel/src/stream.c
index e4ed4caf..07568024 100644
--- a/libcrystfel/src/stream.c
+++ b/libcrystfel/src/stream.c
@@ -585,6 +585,8 @@ static void write_crystal(Stream *st, Crystal *cr, int include_reflections)
num_integrated_reflections(reflist));
fprintf(st->fh, "num_saturated_reflections = %lli\n",
crystal_get_num_saturated_reflections(cr));
+ fprintf(st->fh, "num_implausible_reflections = %lli\n",
+ crystal_get_num_implausible_reflections(cr));
}