Skip to content

Commit 91c5939

Browse files
author
sprenger
committed
[TDT] change dtype, rate and t_start default values for empty streams
1 parent 1603a7c commit 91c5939

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

neo/rawio/tdtrawio.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ def _parse_header(self):
212212
if len(data_index['timestamp']):
213213
t_start = data_index['timestamp'][0]
214214
else:
215-
t_start = None
215+
# if no signal present use segment t_start as dummy value
216+
t_start = self._seg_t_starts[seg_index]
216217
if stream_index not in self._sigs_t_start[seg_index]:
217218
self._sigs_t_start[seg_index][stream_index] = t_start
218219
else:
@@ -223,8 +224,9 @@ def _parse_header(self):
223224
_sampling_rate = float(data_index['frequency'][0])
224225
_dtype = data_formats[data_index['dataformat'][0]]
225226
else:
226-
_sampling_rate = np.nan
227-
_dtype = type(None)
227+
# if no signal present use dummy values
228+
_sampling_rate = 1.
229+
_dtype = int
228230
if sampling_rate is None:
229231
sampling_rate = _sampling_rate
230232
dtype = _dtype

0 commit comments

Comments
 (0)