def medianBin(time, flux, medianWidth):

    numberBins = int(math.ceil(len(time)/float(medianWidth)))
    binnedTime = np.arange(numberBins, dtype=float)
    binnedFlux = np.arange(numberBins, dtype=float)
    binnedStd = np.arange(numberBins, dtype=float)
    for i in range(numberBins):
        fluxInBin = flux[i*medianWidth:(i+1)*medianWidth]
        binnedTime[i] = np.median(time[i*medianWidth:(i+1)*medianWidth])
        binnedFlux[i] = np.median(fluxInBin)
        binnedStd[i] = np.std(fluxInBin)/np.sqrt(len(fluxInBin))
    return binnedTime, binnedFlux, binnedStd
Produce median binning of a flux vector
dataset/ETHPy150Open OSCAAR/OSCAAR/oscaar/mathMethods.py/medianBin