binned_profile¶
-
hcipy.metrics.
binned_profile
(y, x, bins=20, statistic='mean')¶ Create a profile of y(x) in the specified bins.
- Parameters
- yarray_like
The y-coordinates of the data points. This should be 1-dimensional.
- xarray_like
The x-coordinates of the data points. This should be 1-dimensional and the same size as y.
- binsarray_like or integer
The bin edges of the profile. If this is an integer, bins is the number of bins that will be equally distributed along the whole range of x.
- statisticstring
The statistic to compute (default is ‘mean’). The following statistics are available: * ‘mean’: compute the mean of values for points within the bin edges. * ‘sum’: compute the sum of values for points within the bin edges. * ‘min’: compute the minimum of values for points within the bin edges. * ‘max’: compute the maximum of values for point within the bin edges.
- Returns
- bin_centersarray_like
The center of each of the bins.
- profilearray_like
The y-values of the resulting profile.
- std_profilearray_like
The standard deviation within each bin.
- num_per_binarray_like
The number of samples per bin.
- Raises
- RuntimeError
If the number of bins are negative or zero.
- ValueError
If the statistic is not implemented.