# {'TIME': [data], 'CH1': [data], 'CH2': [data]} def cut_time(data : dict, start : float, end : float) -> dict: idx_start = 0 idx_end = 0 for idx, t in enumerate(data['TIME']): if t > start and idx_start == 0: idx_start = idx if t > end and idx_end == 0: idx_end = idx if idx_end != 0 and idx_start != 0: break if idx_end != 0 and idx_start != 0: return {key: value[idx_start:idx_end] for key, value in data.items()} else: raise Exception("Start or end out of range")