Repository navigation
Description
Hi, while I can't comment on whether this is true for all cases, the header is not exposed when loading events. Importantly, the sample rate is nowhere to be found in the recording object. As an example, let data_dir be a path pointing to a directory with .continuous and .events files.
from open_ephys.analysis import Session
session = Session(data_dir)
session.load_events()At this point, it seems the user should be able to determine the sample rate information, as this information is contained within the header for the .events file, however it is apparently discarded:
open-ephys-python-tools/open_ephys/analysis/formats/OpenEphysRecording.py
Lines 130 to 140 in 5b4750f
| def load_events(self): | |
| events_file = os.path.join(self.directory, 'all_channels' + self.experiment_id + ".events") | |
| timestamps, processor_id, state, channel, header = load(events_file, self.recording_index) | |
| self._events = pd.DataFrame(data = {'channel' : channel + 1, | |
| 'timestamp' : timestamps, | |
| 'processor_id' : processor_id, | |
| 'subprocessor_id' : [0] * len(timestamps), | |
| 'state' : state}) |
Certainly, the header information from this events file should be accessible through a recording object. I am unsure what the best way to address is, or if it is already being worked on, but I thought I would bring attention to the problem.
EDIT: I have temporarily solved this for my personal requirements by simply storing the header dict returned by load in self.header.
Activity
jsiegle commentedon Jun 14, 2021
Hi Kyle, thanks for bringing this up. We definitely want this info to be accessible in the
Sessionobject, but I'm not sure about the best place to put it.Would it make sense to add a top-level
metadataproperty that stores general information about the recording (e.g., start time), as well as info about individual processors? For example, the sample rate for each processor could be accessed via:KylePoe commentedon Jun 23, 2021
I think that would be a very natural way to do it.