aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2014-02-17 12:48:37 +0100
committerThomas White <taw@bitwiz.org.uk>2014-02-17 12:48:37 +0100
commit021ddf275adf896de795ffad662f8debc6857317 (patch)
tree03e6132ec9e6987a301b2def0f86c6f9a8ea466a
parent512af3db1c82578f0c82275c5cea70e04b9915d4 (diff)
Add histogram_get_data()
-rw-r--r--libcrystfel/src/histogram.c12
-rw-r--r--libcrystfel/src/histogram.h8
2 files changed, 17 insertions, 3 deletions
diff --git a/libcrystfel/src/histogram.c b/libcrystfel/src/histogram.c
index ceefbe4b..bd925aea 100644
--- a/libcrystfel/src/histogram.c
+++ b/libcrystfel/src/histogram.c
@@ -167,6 +167,18 @@ static void calc_stddev(Histogram *hi)
}
+int *histogram_get_data(Histogram *hi, double *min, double *max, int *n)
+{
+ calc_bins(hi);
+
+ *n = hi->n_bins;
+ *min = hi->min;
+ *max = hi->max;
+
+ return hi->bins;
+}
+
+
void histogram_show(Histogram *hi)
{
int i;
diff --git a/libcrystfel/src/histogram.h b/libcrystfel/src/histogram.h
index bf8c5f1e..bcd000a5 100644
--- a/libcrystfel/src/histogram.h
+++ b/libcrystfel/src/histogram.h
@@ -3,11 +3,11 @@
*
* Quick histogram functions
*
- * Copyright © 2013 Deutsches Elektronen-Synchrotron DESY,
- * a research centre of the Helmholtz Association.
+ * Copyright © 2013-2014 Deutsches Elektronen-Synchrotron DESY,
+ * a research centre of the Helmholtz Association.
*
* Authors:
- * 2013 Thomas White <taw@physics.org>
+ * 2013-2014 Thomas White <taw@physics.org>
*
* This file is part of CrystFEL.
*
@@ -41,5 +41,7 @@ extern void histogram_free(Histogram *hi);
extern void histogram_add_value(Histogram *hi, double val);
extern void histogram_show(Histogram *hi);
+extern int *histogram_get_data(Histogram *hi, double *min, double *max, int *n);
+
#endif /* HISTOGRAM_H */