def runningMedian(t, y, dt, runt):
    '\n    Take a running median of size dt\n    Return values at times given in runt\n    '
    newy = np.zeros(len(y))
    newt = np.zeros(len(y))
    srt = np.argsort(t)
    newt = t[srt]
    newy = y[srt]
    runy = []
    for i in range(len(runt)):
        tmp = []
        for j in range(len(newt)):
            if ((newt[j] >= (runt[i] - dt)) and (newt[j] <= (runt[i] + dt))):
                tmp.append(newy[j])
        if np.isnan(np.nanmedian(np.array(tmp))):
            runy.append(0)
        else:
            runy.append(np.nanmedian(np.array(tmp)))
    return (list(runt), runy)
Take a running median of size dt
Return values at times given in runt
def runningMedian(t, y, dt, runt):
    '\n    Take a running median of size dt\n    Return values at times given in runt\n    '
    newy = np.zeros(len(y))
    newt = np.zeros(len(y))
    srt = np.argsort(t)
    newt = t[srt]
    newy = y[srt]
    runy = []
    for i in range(len(runt)):
        tmp = []
        for j in range(len(newt)):
            if ((newt[j] >= (runt[i] - dt)) and (newt[j] <= (runt[i] + dt))):
                tmp.append(newy[j])
        if np.isnan(np.nanmedian(np.array(tmp))):
            runy.append(0)
        else:
            runy.append(np.nanmedian(np.array(tmp)))
    return (list(runt), runy)