eeg_tools.
load_data
(h5file, nodes=None)[source]¶Load data from HDF5 container generated with read_eeg
Parameters: | h5file : str or h5py.File instance
nodes : list or NumPy 1darray
|
---|---|
Returns: | data : NumPy 2darray
|
Notes
The raw iEEG data are stored as int16. This routine normalizes (divides by max(int16)) and rescales the data based on the original channel sensitivity (read from the HDF5 container).
Examples
Suppose we want to read data stored in the file iEEG.h5. To access all of its contents use
>>> data = load_data('iEEG.h5')
>>> data.shape
>>> (84, 9000000)
If the HDF5 container is already open and only electrodes RFA1 and RFB1 should be read use
>>> import h5py
>>> f = h5py.File('iEEG.h5')
>>> data = load_data(f,nodes=['RFA1','RFB1'])
>>> data.shape
>>> (2, 9000000)
Alternatively, nodes can be specified using their indices in the file
>>> data = load_data(f,nodes=np.array([12,33]))
>>> data.shape
>>> (2, 9000000)