示例#1
0
 def __init__(self, uri, dataset=None, **kwds):
     #---------------------------------------------
     newfile = kwds.pop('create', False)
     if uri is None and (newfile or dataset is None):
         raise TypeError("No URI given for HDF5 recording")
     if uri is not None:
         BSMLRecording.__init__(self, uri, dataset, **kwds)
     if dataset:
         if newfile:
             self._h5 = H5Recording.create(uri, str(dataset), **kwds)
             self.graph = RecordingGraph(uri, rec_class=HDF5Recording)
         else:
             self._h5 = H5Recording.open(dataset, **kwds)
             if uri is None:
                 BSMLRecording.__init__(self, self._h5.uri, dataset, **kwds)
             elif str(uri) != str(self._h5.uri):
                 raise TypeError("Wrong URI in HDF5 recording")
             self._load_metadata()
             for n, s in enumerate(self._h5.signals()):
                 signal = HDF5Signal.create_from_H5Signal(n, s)
                 signal.add_metadata(self.graph)
                 signal.clock.add_metadata(
                     self.graph)  ## We need to cache clocks in recording...
                 self.add_signal(signal)
     else:
         self._h5 = None
示例#2
0
 def __init__(self, uri, dataset=None, **kwds):
     # ---------------------------------------------
     newfile = kwds.pop("create", False)
     if uri is None and (newfile or dataset is None):
         raise TypeError("No URI given for HDF5 recording")
     if uri is not None:
         BSMLRecording.__init__(self, uri, dataset, **kwds)
     if dataset:
         if newfile:
             self._h5 = H5Recording.create(uri, str(dataset), **kwds)
             self.graph = RecordingGraph(uri, rec_class=HDF5Recording)
         else:
             self._h5 = H5Recording.open(dataset, **kwds)
             if uri is None:
                 BSMLRecording.__init__(self, self._h5.uri, dataset, **kwds)
             elif str(uri) != str(self._h5.uri):
                 raise TypeError("Wrong URI in HDF5 recording")
             self._load_metadata()
             for n, s in enumerate(self._h5.signals()):
                 signal = HDF5Signal.create_from_H5Signal(n, s)
                 signal.add_metadata(self.graph)
                 signal.clock.add_metadata(self.graph)  ## We need to cache clocks in recording...
                 self.add_signal(signal)
     else:
         self._h5 = None
示例#3
0
 def __init__(self, uri, dataset=None, **kwds):
     #---------------------------------------------
     BSMLRecording.__init__(self, uri=uri, dataset=dataset, **kwds)
     self._edffile = None
     newfile = kwds.pop('create', False)
     if dataset:
         if newfile: pass  ## Future...
         else:
             self.initialise()
             self._set_attributes()
示例#4
0
 def __init__(self, uri, dataset=None, **kwds):
 #---------------------------------------------
   BSMLRecording.__init__(self, uri=uri, dataset=dataset, **kwds)
   self._edffile = None
   newfile = kwds.pop('create', False)
   if dataset:
     if newfile: pass  ## Future...
     else:
       self.initialise()
       self._set_attributes()
示例#5
0
 def __init__(self, uri, fname=None, **kwds):
 #-------------------------------------------
   BSMLRecording.__init__(self, uri=uri, fname=fname, **kwds)
   self._siginfo = None