bin

tayph.bin(x, y, n, err=[])[source] [edit on github]

A simple function to quickly bin a spectrum by a certain number of points.

Parameters
xlist, np.ndarray

The horizontal axis.

ylist, np.ndarray

The array corresponding to x.

nint, float

The number of points by which to bin. Int is recommended, and it is converted to int if a float is provided, with the consequence of the rounding that int() does.

errlist, np.array, optional

If set, errors corresponding to the flux points.

Returns
x_binnp.array

The binned x-axis.

y_binnp.array

The binned y-axis.

e_binnp.array

Only if err is set to an array with non-zero length.