atompy.centers_to_edges#

atompy.centers_to_edges(centers, lower=None, upper=None)[source]#

Work out bin edges from bin centers.

If the bins don’t have constant size, at least one limit has to be provided, from which the edges can be determined

Parameters:
centersndarray, shape(n)

centers of the bins

lower, uppperfloat, optional

Lower and upper limits of the bins.

At least one limit must be provided if bins don’t have a constant size. If both lower and upper limits are provided, the lower one will be prioritized.

Returns:
edgesndarray, shape(n+1)

Edges of the bins.