|
SDDS ToolKit Programs and Libraries for C and Python
|
Compiles histograms from data points.
This file contains functions to compile histograms from data points. It provides both standard and weighted histogram functions, as well as a function to compute the mode of a dataset.
Definition in file makeHistogram.c.
#include "mdb.h"Go to the source code of this file.
Functions | |
| long | make_histogram (double *hist, long n_bins, double lo, double hi, double *data, int64_t n_pts, long new_start) |
| Compiles a histogram from data points. | |
| long | make_histogram_weighted (double *hist, long n_bins, double lo, double hi, double *data, long n_pts, long new_start, double *weight) |
| Compiles a weighted histogram from data points. | |
| long | computeMode (double *result, double *data, long pts, double binSize, long bins) |
| Computes the mode of a dataset using histogram binning. | |
| long computeMode | ( | double * | result, |
| double * | data, | ||
| long | pts, | ||
| double | binSize, | ||
| long | bins ) |
Computes the mode of a dataset using histogram binning.
| result | Pointer to store the computed mode value. |
| data | Pointer to the data array. |
| pts | Number of data points. |
| binSize | Size of each histogram bin. If greater than 0, determines the bin size; otherwise, the number of bins is used. |
| bins | Number of bins in the histogram. |
Definition at line 115 of file makeHistogram.c.
| long make_histogram | ( | double * | hist, |
| long | n_bins, | ||
| double | lo, | ||
| double | hi, | ||
| double * | data, | ||
| int64_t | n_pts, | ||
| long | new_start ) |
Compiles a histogram from data points.
| hist | Pointer to the histogram array to be filled. |
| n_bins | Number of bins in the histogram. |
| lo | Lower bound of the histogram range. |
| hi | Upper bound of the histogram range. |
| data | Pointer to the data array. |
| n_pts | Number of data points. |
| new_start | Flag indicating whether to initialize the histogram (1 to initialize, 0 to accumulate). |
Definition at line 33 of file makeHistogram.c.
| long make_histogram_weighted | ( | double * | hist, |
| long | n_bins, | ||
| double | lo, | ||
| double | hi, | ||
| double * | data, | ||
| long | n_pts, | ||
| long | new_start, | ||
| double * | weight ) |
Compiles a weighted histogram from data points.
| hist | Pointer to the histogram array to be filled. |
| n_bins | Number of bins in the histogram. |
| lo | Lower bound of the histogram range. |
| hi | Upper bound of the histogram range. |
| data | Pointer to the data array. |
| n_pts | Number of data points. |
| new_start | Flag indicating whether to initialize the histogram (1 to initialize, 0 to accumulate). |
| weight | Pointer to the weights array corresponding to each data point. |
Definition at line 74 of file makeHistogram.c.