def __init__(self, filepath): """ Initialize the interface to the data. Parameters ---------- filepath : string String specifiying the filename (with full path if applicable). """ # set up the basic params of the data if os.path.exists(filepath): self.filepath = filepath else: raise IOError( str(filepath) + '\n does not exist!' + 'Valid path to data file is needed!') self._nchannels = read_number_of_signals(self.filepath) numbers = [] names = [] for i in range(self._nchannels): numbers.append(i + 1) # CTW: Here we should use the actual channel labels as # name -- requires additional cython code to interface # with the EDF library: names.append(str(i + 1)) self._channel_info = np.rec.fromarrays([numbers, names], names='number,name')
def __init__(self, filepath): """ Initialize the interface to the data. Parameters ---------- filepath : string String specifiying the filename (with full path if applicable). """ # set up the basic params of the data if os.path.exists(filepath): self.filepath = filepath else: raise IOError(str(filepath)+'\n does not exist!'+ 'Valid path to data file is needed!') self._nchannels = read_number_of_signals(self.filepath) numbers = [] names = [] for i in range(self._nchannels): numbers.append(i+1) # CTW: Here we should use the actual channel labels as # name -- requires additional cython code to interface # with the EDF library: names.append(str(i+1)) self._channel_info = np.rec.fromarrays( [numbers, names], names='number,name')
def _get_nchannels(self): return read_number_of_signals(self.filepath)
def _get_channels(self): # this needs to be replaced by a list of the propper channel labels! # return [str(channel) # for channel in range(read_number_of_signals(self.filepath))] return [channel for channel in range(read_number_of_signals(self.filepath))]