diff options
-rw-r--r-- | libcrystfel/src/histogram.c | 12 | ||||
-rw-r--r-- | libcrystfel/src/histogram.h | 8 |
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 */ |