def extract_lsts(data, lsts, lst0, lst1): i0 = closest(lsts, lst0) i1 = closest(lsts, lst1) # print i0, i1, data.shape lsts = lsts[i0:i1] D = data[i0:i1] return lsts, D
def trim(data, f, f0): i0 = closest(f, f0) try: return f[i0:], data[:, i0:] except: return f[i0:], data[i0:]
def trim2(data, f, f0, f1): i0 = closest(f, f0) i1 = closest(f, f1) return f[i0:i1], data[i0:i1]