From 36e3370feddeb8dd18f97dc5db4da8e96c9f5c79 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 17 May 2019 17:03:28 +0200 Subject: s/histogram/pdf/ --- libcrystfel/src/spectrum.c | 11 +++++------ libcrystfel/src/spectrum.h | 6 +++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/libcrystfel/src/spectrum.c b/libcrystfel/src/spectrum.c index 21b21f80..f1ada734 100644 --- a/libcrystfel/src/spectrum.c +++ b/libcrystfel/src/spectrum.c @@ -313,7 +313,7 @@ void spectrum_set_gaussians(Spectrum *s, struct gaussian *gs, int n_gauss) /* Samples must already have been sorted */ -static void normalise_histogram(double *k, double *pdf, int n) +static void normalise_pdf(double *k, double *pdf, int n) { int i; double total_area = 0.0; @@ -325,7 +325,7 @@ static void normalise_histogram(double *k, double *pdf, int n) old_pdf = pdf[i]; } - printf("total area under histogram = %f\n", total_area); + printf("total area under PDF = %f\n", total_area); for ( i=0; igaussians); @@ -368,7 +367,7 @@ void spectrum_set_histogram(Spectrum *s, double *kvals, double *heights, s->rep = SPEC_HISTOGRAM; gsl_sort2(s->k, 1, s->pdf, 1, n); - normalise_histogram(s->k, s->pdf, s->n_samples); + normalise_pdf(s->k, s->pdf, s->n_samples); } @@ -397,7 +396,7 @@ static int read_esrf_spectrum(FILE *fh, Spectrum *s) } - spectrum_set_histogram(s, k, samp, n_bins); + spectrum_set_pdf(s, k, samp, n_bins); free(k); free(samp); diff --git a/libcrystfel/src/spectrum.h b/libcrystfel/src/spectrum.h index b3786c53..d31318fd 100644 --- a/libcrystfel/src/spectrum.h +++ b/libcrystfel/src/spectrum.h @@ -72,9 +72,9 @@ extern void spectrum_set_gaussians(Spectrum *s, struct gaussian *gs, extern int spectrum_get_num_gaussians(Spectrum *s); extern struct gaussian spectrum_get_gaussian(Spectrum *s, int n); -/* Representation as histogram */ -extern void spectrum_set_histogram(Spectrum *s, double *kcens, double *heights, - int nbins); +/* Representation as PDF */ +extern void spectrum_set_pdf(Spectrum *s, double *kcens, double *heights, + int nbins); extern void spectrum_get_range(Spectrum *s, double *kmin, double *kmax); extern double spectrum_get_density_at_k(Spectrum *s, double k); -- cgit v1.2.3