Create a data model abstraction to deal with categorical segments of time series data. Indexing is annoying with all the various time segments. Something like this would be nice:
# returns list of arrays, each array corresponds to a trial period.
calcium[:, exp.segments.trial]
calcium[:, exp.labels.ethogram.chew[True] + pint.parse("3 ms")]
# inter trial interval
calcium[:, ~exp.segmemts.trial]
# each frame can have categorical labels such as the trial index. Need to decide how to count post trial intervals, make just could it as part of the previous trial for this index
calcium[:, exp.segments.trial] / calcium[:, exp.segments.pre_trial].mean(groupby=exp.labels.trial_ix)
# indexing cells
calcium[pc_dim2_weights > 2, exp.labels.ethogram.chew[True] + pint.parse("3 ms")]
Create a data model abstraction to deal with categorical segments of time series data. Indexing is annoying with all the various time segments. Something like this would be nice: