Closed balandongiv closed 5 years ago
1) Python is generally not good with using multiple cores. Therefore I use a multiprocessing.pool
for parallel data processing (speeding things up.). In this example, I run the resampling in parallel, which makes it almost 3x faster.
2) mne.io.RawArray
needs a 2D input (channels x samples). We have a 1D data series (one ExG channel). np.stack([array1d])
converts a 1D array to a 2D array. Not sure why I don't use np.reshape(data, [1, -1])
, but I assume there was a reason (probably something with views and copies).
Hi Simon, may I know what is the function of these lines? I had dissect to understand its purpose, but turn out no where. Appreciate if you can shed some light
Especially, the need of the pool.apply and RawArray here. I had read the documentation, but still unable to relate why you used it here.