strax icon indicating copy to clipboard operation
strax copied to clipboard

Chunk interval index

Open jmosbacher opened this issue 3 years ago • 1 comments

Implementation of #433, lazily constructs an IntervalIndex for chunks. The index can be used for fast overlap tests also added a overlaps method to strax.Chunk which returns all data that overlaps with a given interval. Can you give a minimal working example (or illustrate with a figure)?

import strax
import straxen

st = straxen.contexts.demo()
c = next(st.get_iter( '180423_1021','raw_records',))
idx = np.random.randint(len(c.data))
row = c.data[idx]
overlapping_data = c.overlaps(row['time'] , row['time'] + row['dt'])

jmosbacher avatar Aug 28 '21 19:08 jmosbacher