spkit.mea.arrange_mea_grid

spkit.mea.arrange_mea_grid(features, ch_labels, grid=(8, 8), default=nan)

Arranging features into MEA-Grid Matrix: Feature Matrix

Arranging features into MEA-Grid Matrix: Feature Matrix

Arranging a list of features for each channel in a MEA-Grid form

Parameters:
featureslist/array
  • array/list of feature values corresponding to channels as listed by ch_labels

ch_labels: list
  • list of channel labels corresponding to features

grid: (8,8)
  • grid size

default: =np.nan
  • default values to fill matrix,

Returns:
M: 2d array MEA8x8 Grid
  • of shape = grid

Examples

>>> #sp.mea.arrange_mea_grid
>>> import numpy as np
>>> import matplotlib.pyplot as plt
>>> import spkit as sp
>>> ch_labels = np.array([47, 48, 46, 45, 38, 37, 28, 36, 27, 17, 26, 16, 35, 25, 15, 14, 24,
>>>     34, 13, 23, 12, 22, 33, 21, 32, 31, 44, 43, 41, 42, 52, 51, 53, 54,
>>>     61, 62, 71, 63, 72, 82, 73, 83, 64, 74, 84, 85, 75, 65, 86, 76, 87,
>>>     77, 66, 78, 67, 68, 55, 56, 58, 57])
>>> features = sp.create_signal_1d(n=60,seed=1)*20
>>> M = sp.mea.arrange_mea_grid(features,ch_labels=ch_labels,grid=(8,8),default=np.nan)
>>> print(M.round(1))
    array([[  nan,   9.9,  -4.9,   0.6,  15.6,  15.3,  14.8,   nan],
            [ 19.1,  19.8,   0.1,   7.2,  13.5,  15.9,  20. ,  16.4],
            [ 11.9,  18.4,  16.2,  -1.9,  14.2,  18.8,  13.2,  12.2],
            [  1.2,   0.7,   5.3,  -5.1,  13.8,   6.2,   2.9,  -0. ],
            [ -0.7,   0.7,   1.6, -20. ,  -1.4, -12.2,  -9.3,  -4.5],
            [  5.3,   4. ,  -0.1, -19.9,   0.5,  -9.8, -13.6, -13.8],
            [  4.8,   2.5, -10.9, -10.5,  -3. ,  -6.6, -12. , -12.8],
            [  nan,  -6.3, -17.5, -16.3,  -1.1,  -5.2,  -8.3,   nan]])

Examples using spkit.mea.arrange_mea_grid

MEA: Step-wise Analysis: Example

MEA: Step-wise Analysis: Example