Convert a list of bin edges to their centers
Given a list of edge values for a set of bins, finds the center of each bin. (start of bin n+1 is assumed to be end of bin n).
Center of bin n is arithmetic mean of the edges of the adjacent bins.
Parameters: | edges : list
|
---|---|
Returns: | out : numpy.ndarray
**note: returned array will be one element shorter than edges** : |
Examples
>>> import spacepy.toolbox as tb
>>> tb.bin_center_to_edges([1,2,3])
[0.5, 1.5, 2.5, 3.5]