Skip to content

Commit 0a93fc7

Browse files
authored
Merge branch 'master' into fix-plexon2-action
2 parents b9e4005 + 1dad7e2 commit 0a93fc7

File tree

7 files changed

+497
-298
lines changed

7 files changed

+497
-298
lines changed

neo/rawio/neuralynxrawio/ncssections.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,19 @@
3737
import math
3838
import numpy as np
3939

40+
from enum import IntEnum, auto
41+
42+
43+
class AcqType(IntEnum):
44+
PRE4 = auto()
45+
BML = auto()
46+
DIGITALLYNX = auto()
47+
DIGITALLYNXSX = auto()
48+
CHEETAH64 = auto()
49+
RAWDATAFILE = auto()
50+
CHEETAH560 = auto()
51+
ATLAS = auto()
52+
UNKNOWN = auto()
4053

4154
class NcsSections:
4255
"""
@@ -250,7 +263,7 @@ def build_for_ncs_file(ncsMemMap, nlxHdr, gapTolerance=None, strict_gap_mode=Tru
250263
acqType = nlxHdr.type_of_recording()
251264
freq = nlxHdr["sampling_rate"]
252265

253-
if acqType == "PRE4":
266+
if acqType == AcqType.PRE4:
254267
# Old Neuralynx style with truncated whole microseconds for actual sampling. This
255268
# restriction arose from the sampling being based on a master 1 MHz clock.
256269
microsPerSampUsed = math.floor(NcsSectionsFactory.get_micros_per_samp_for_freq(freq))
@@ -266,7 +279,8 @@ def build_for_ncs_file(ncsMemMap, nlxHdr, gapTolerance=None, strict_gap_mode=Tru
266279
ncsSects.sampFreqUsed = sampFreqUsed
267280
ncsSects.microsPerSampUsed = microsPerSampUsed
268281

269-
elif acqType in ["DIGITALLYNX", "DIGITALLYNXSX", "CHEETAH64", "CHEETAH560", "RAWDATAFILE"]:
282+
elif acqType in [AcqType.DIGITALLYNX, AcqType.DIGITALLYNXSX, AcqType.CHEETAH64,
283+
AcqType.CHEETAH560, AcqType.RAWDATAFILE]:
270284
# digital lynx style with fractional frequency and micros per samp determined from block times
271285
if gapTolerance is None:
272286
if strict_gap_mode:
@@ -293,7 +307,7 @@ def build_for_ncs_file(ncsMemMap, nlxHdr, gapTolerance=None, strict_gap_mode=Tru
293307
ncsSects.sampFreqUsed = sampFreqUsed
294308
ncsSects.microsPerSampUsed = NcsSectionsFactory.get_micros_per_samp_for_freq(sampFreqUsed)
295309

296-
elif acqType == "BML" or acqType == "ATLAS":
310+
elif acqType == AcqType.BML or acqType == AcqType.ATLAS:
297311
# BML & ATLAS style with fractional frequency and micros per samp
298312
if strict_gap_mode:
299313
# this is the old behavior, maybe we could put 0.9 sample interval no ?

neo/rawio/neuralynxrawio/neuralynxrawio.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
_spike_channel_dtype,
5454
_event_channel_dtype,
5555
)
56-
from operator import itemgetter
5756
import numpy as np
5857
import os
5958
import pathlib

0 commit comments

Comments
 (0)