本文整理汇总了Python中neo.io.baseio.BaseIO.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python BaseIO.__init__方法的具体用法?Python BaseIO.__init__怎么用?Python BaseIO.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类neo.io.baseio.BaseIO
的用法示例。
在下文中一共展示了BaseIO.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from neo.io.baseio import BaseIO [as 别名]
# 或者: from neo.io.baseio.BaseIO import __init__ [as 别名]
def __init__(self, filename, mode="rw"):
"""
Initialise IO instance and NIX file.
:param filename: Full path to the file
"""
if not HAVE_NIX:
raise Exception("Failed to import NIX. "
"The NixIO requires the Python bindings for NIX "
"(nixio on PyPi). Try `pip install nixio`.")
BaseIO.__init__(self, filename)
self.filename = filename
if mode == "ro":
filemode = nix.FileMode.ReadOnly
elif mode == "rw":
filemode = nix.FileMode.ReadWrite
elif mode == "ow":
filemode = nix.FileMode.Overwrite
else:
raise ValueError("Invalid mode specified '{}'. "
"Valid modes: 'ro' (ReadOnly)', 'rw' (ReadWrite),"
" 'ow' (Overwrite).".format(mode))
self.nix_file = nix.File.open(self.filename, filemode, backend="h5py")
self._neo_map = dict()
self._nix_map = dict()
self._lazy_loaded = list()
self._object_hashes = dict()
self._block_read_counter = 0
self._path_map = dict()
示例2: __init__
# 需要导入模块: from neo.io.baseio import BaseIO [as 别名]
# 或者: from neo.io.baseio.BaseIO import __init__ [as 别名]
def __init__(self, filename, dataset=0):
"""
Arguments:
filename : the filename
dataset: points to a specific dataset in the .kwik and .raw.kwd file,
however this can be an issue to change in e.g. OpenElectrophy or Spykeviewer
"""
BaseIO.__init__(self)
self._filename = filename
self._path, file = os.path.split(filename)
self._kwik = h5py.File(filename, "r")
self._dataset = dataset
try:
rawfile = self._kwik["recordings"][str(self._dataset)]["raw"].attrs[
"hdf5_path"
] # klustakwik/phy and newest version of open ephys
rawfile = rawfile.split("/")[0]
except:
rawfile = file.split(".")[0] + "_100.raw.kwd" # first version of open ephys files
self._kwd = h5py.File(self._path + os.sep + rawfile, "r")
self._attrs = {}
self._attrs["kwik"] = self._kwik["recordings"][str(self._dataset)].attrs
self._attrs["kwd"] = self._kwd["recordings"][str(self._dataset)].attrs
self._attrs["shape"] = self._kwd["recordings"][str(self._dataset)]["data"].shape
try:
self._attrs["app_data"] = self._kwd["recordings"][str(self._dataset)][
"application_data"
].attrs # TODO: find bitvolt conversion in phy generated data
except:
self._attrs["app_data"] = False
示例3: __init__
# 需要导入模块: from neo.io.baseio import BaseIO [as 别名]
# 或者: from neo.io.baseio.BaseIO import __init__ [as 别名]
def __init__(self, filename=None):
"""
Arguments:
filename : the filename
"""
BaseIO.__init__(self, filename)
示例4: __init__
# 需要导入模块: from neo.io.baseio import BaseIO [as 别名]
# 或者: from neo.io.baseio.BaseIO import __init__ [as 别名]
def __init__(self, filename):
if not HAVE_H5PY:
raise ImportError("h5py is not available")
BaseIO.__init__(self, filename=filename)
self._data = h5py.File(filename, 'r')
self.object_refs = {}
self._lazy = False
示例5: __init__
# 需要导入模块: from neo.io.baseio import BaseIO [as 别名]
# 或者: from neo.io.baseio.BaseIO import __init__ [as 别名]
def __init__(self, filename, dataset=0) :
"""
Arguments:
filename : the filename
dataset: points to a specific dataset in the .kwik and .raw.kwd file,
however this can be an issue to change in e.g. OpenElectrophy or Spykeviewer
"""
BaseIO.__init__(self)
self._filename = filename
self._path, file = os.path.split(filename)
self._kwik = h5py.File(filename, 'r')
self._dataset = dataset
try:
rawfile = self._kwik['recordings'][str(self._dataset)]['raw'].attrs['hdf5_path'] # klustakwik/phy and newest version of open ephys
rawfile = rawfile.split('/')[0]
except:
rawfile = file.split('.')[0] + '_100.raw.kwd' # first version of open ephys files
self._kwd = h5py.File(self._path + os.sep + rawfile, 'r')
self._attrs = {}
self._attrs['kwik'] = self._kwik['recordings'][str(self._dataset)].attrs
self._attrs['kwd'] = self._kwd['recordings'][str(self._dataset)].attrs
self._attrs['shape'] = self._kwd['recordings'][str(self._dataset)]['data'].shape
try:
self._attrs['app_data'] = self._kwd['recordings'][str(self._dataset)]['application_data'].attrs # TODO: find bitvolt conversion in phy generated data
except:
self._attrs['app_data'] = False
示例6: __init__
# 需要导入模块: from neo.io.baseio import BaseIO [as 别名]
# 或者: from neo.io.baseio.BaseIO import __init__ [as 别名]
def __init__(self, filename=None):
"""
Parameters
----------
filename: string, default=None
The filename.
"""
BaseIO.__init__(self, filename=filename)
示例7: __init__
# 需要导入模块: from neo.io.baseio import BaseIO [as 别名]
# 或者: from neo.io.baseio.BaseIO import __init__ [as 别名]
def __init__(self, filename=None):
"""
This class read a abf file.
Arguments:
filename : the filename to read
"""
BaseIO.__init__(self)
self.filename = filename
示例8: __init__
# 需要导入模块: from neo.io.baseio import BaseIO [as 别名]
# 或者: from neo.io.baseio.BaseIO import __init__ [as 别名]
def __init__(self, filename=None):
"""
This class read/write a elan based file.
**Arguments**
filename : the filename to read or write
"""
BaseIO.__init__(self)
self.filename = filename
示例9: __init__
# 需要导入模块: from neo.io.baseio import BaseIO [as 别名]
# 或者: from neo.io.baseio.BaseIO import __init__ [as 别名]
def __init__(self , filename = '', dllname = '') :
"""
Arguments:
filename: the file to read
ddlname: the name of neuroshare dll to be used for this file
"""
BaseIO.__init__(self)
self.dllname = dllname
self.filename = filename
示例10: __init__
# 需要导入模块: from neo.io.baseio import BaseIO [as 别名]
# 或者: from neo.io.baseio.BaseIO import __init__ [as 别名]
def __init__(self , filename = None) :
"""
Arguments:
filename : the .map Alpha Omega file name
"""
BaseIO.__init__(self)
self.filename = filename
示例11: __init__
# 需要导入模块: from neo.io.baseio import BaseIO [as 别名]
# 或者: from neo.io.baseio.BaseIO import __init__ [as 别名]
def __init__(self, filename=None):
"""
Arguments:
filename: the filename
"""
BaseIO.__init__(self)
self._path = filename
self._filename = os.path.basename(filename)
self._fsrc = None
示例12: __init__
# 需要导入模块: from neo.io.baseio import BaseIO [as 别名]
# 或者: from neo.io.baseio.BaseIO import __init__ [as 别名]
def __init__(self, filename) :
"""
"""
BaseIO.__init__(self)
# remove extension because there is bunch of files : nev, ns1, ..., ns5, nsf
for ext in self.extensions:
if filename.endswith('.'+ext):
filename = filename.strip('.'+ext)
self.filename = filename
示例13: __init__
# 需要导入模块: from neo.io.baseio import BaseIO [as 别名]
# 或者: from neo.io.baseio.BaseIO import __init__ [as 别名]
def __init__(self, filename):
"""
Arguments:
filename : the filename
"""
BaseIO.__init__(self)
self.filename = os.path.abspath(filename)
model = kwik.KwikModel(self.filename) # TODO this group is loaded twice
self.models = [kwik.KwikModel(self.filename, channel_group=grp)
for grp in model.channel_groups]
示例14: __init__
# 需要导入模块: from neo.io.baseio import BaseIO [as 别名]
# 或者: from neo.io.baseio.BaseIO import __init__ [as 别名]
def __init__(self , filename = None) :
"""
This class read a WinEDR file.
Arguments:
filename : the filename
"""
BaseIO.__init__(self)
self.filename = filename
示例15: __init__
# 需要导入模块: from neo.io.baseio import BaseIO [as 别名]
# 或者: from neo.io.baseio.BaseIO import __init__ [as 别名]
def __init__(self, filename=None, **kwargs):
if not HAVE_TABLES:
raise TABLES_ERR
BaseIO.__init__(self, filename=filename)
self.connected = False
self.objects_by_ref = {} # Loaded objects by reference id
self.parent_paths = {} # Tuples of (Segment, other parent) paths
self.name_indices = {}
if filename:
self.connect(filename=filename)