Skip to content

Commit 5fe92d5

Browse files
author
sprenger
committed
[axona] change default dtype for header item conversion from int to float
1 parent 5f3a7c0 commit 5fe92d5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

neo/rawio/axonarawio.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,8 @@ def _get_spike_timestamps(self, block_index, seg_index, unit_index,
371371

372372
def _rescale_spike_timestamp(self, spike_timestamps, dtype):
373373
spike_times = spike_timestamps.astype(dtype)
374-
spike_times /= self._to_hz(self.file_parameters['unit']['timebase'])
374+
spike_times /= self._to_hz(self.file_parameters['unit']['timebase'],
375+
dtype=int)
375376
return spike_times
376377

377378
def _get_spike_raw_waveforms(self, block_index, seg_index, unit_index,
@@ -437,8 +438,8 @@ def _get_temporal_mask(self, t_start, t_stop, tetrode_id):
437438
# convert t_start and t_stop to sampling frequency
438439
# Note: this assumes no time offset!
439440
unit_params = self.file_parameters['unit']
440-
lim0 = t_start * self._to_hz(unit_params['timebase'])
441-
lim1 = t_stop * self._to_hz(unit_params['timebase'])
441+
lim0 = t_start * self._to_hz(unit_params['timebase'], dtype=int)
442+
lim1 = t_stop * self._to_hz(unit_params['timebase'], dtype=int)
442443

443444
mask = (unit_spikes >= lim0) & (unit_spikes <= lim1)
444445

@@ -578,5 +579,5 @@ def _get_signal_chan_header(self):
578579

579580
return np.array(sig_channels, dtype=_signal_channel_dtype)
580581

581-
def _to_hz(self, param, dtype=int):
582+
def _to_hz(self, param, dtype=float):
582583
return dtype(param.replace(' hz', ''))

0 commit comments

Comments
 (0)