File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
element_array_ephys/readers Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -35,11 +35,18 @@ class OpenEphys:
35
35
def __init__ (self , experiment_dir ):
36
36
self .session_dir = pathlib .Path (experiment_dir )
37
37
38
- openephys_file = pyopenephys .File (self .session_dir .parent ) # this is on the Record Node level
38
+ if self .session_dir .name .startswith ('recording' ):
39
+ openephys_file = pyopenephys .File (self .session_dir .parent .parent ) # this is on the Record Node level
40
+ self ._is_recording_folder = True
41
+ else :
42
+ openephys_file = pyopenephys .File (self .session_dir .parent ) # this is on the Record Node level
43
+ self ._is_recording_folder = False
39
44
40
45
# extract the "recordings" for this session
41
46
self .experiment = next (experiment for experiment in openephys_file .experiments
42
- if pathlib .Path (experiment .absolute_foldername ) == self .session_dir )
47
+ if pathlib .Path (experiment .absolute_foldername ) == (
48
+ self .session_dir .parent if self ._is_recording_folder else self .session_dir )
49
+ )
43
50
44
51
# extract probe data
45
52
self .probes = self .load_probe_data ()
@@ -106,6 +113,9 @@ def load_probe_data(self):
106
113
probe = probes [probe_SN ]
107
114
108
115
for rec in self .experiment .recordings :
116
+ if self ._is_recording_folder and rec .absolute_foldername != self .session_dir :
117
+ continue
118
+
109
119
assert len (rec ._oebin ['continuous' ]) == len (rec .analog_signals ), \
110
120
f'Mismatch in the number of continuous data' \
111
121
f' - expecting { len (rec ._oebin ["continuous" ])} (from structure.oebin file),' \
You can’t perform that action at this time.
0 commit comments