spkit.mea.unarrange_mea_grid

spkit.mea.unarrange_mea_grid(M, ch_labels)
Reverse the operation of ‘arrange_mea_grid’

That is given Feature Matrix of MEA grid, arrange it in order of ch_labels

Parameters:
MMEA Grid Matrix
ch_labels: chanel labels
Returns:
f: 1d-array

Examples

>>> #sp.mea.unarrange_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])
>>> Ax = (sp.create_signal_2d(n=8,sg_winlen=5, sg_polyorder=1,seed=2)*30).round(1)
>>> Ax[[0,0,7,7],[0,7,0,7]] = np.nan
>>> print(Ax)
    [[ nan  2.5  1.9  0.   2.   0.7  3.1  nan]
    [ 5.9  5.   4.   2.2  2.5  1.4  3.4  5.5]
    [ 8.9  7.5  6.1  4.4  3.1  2.   3.8  5.5]
    [17.5 14.  10.5  7.5  5.4  3.7  6.4  9.1]
    [23.1 17.8 12.4  9.8  6.2  2.4  4.1  5.8]
    [14.2 13.8 13.4 14.3 13.2  9.1  8.3  7.5]
    [14.3 16.4 18.5 20.5 21.6 13.9  9.7  5.6]
    [ nan 19.  23.7 26.6 30.  18.7 11.2  nan]]
>>> F = sp.mea.unarrange_mea_grid(Ax,ch_labels=ch_labels)
>>> print(F)
    [20.5 26.6 14.3  9.8 23.7 18.5 19.  13.4 16.4 14.3 13.8 14.2 12.4 17.8
    23.1 17.5 14.  10.5  8.9  7.5  5.9  5.   6.1  2.5  4.   1.9  7.5  4.4
    0.   2.2  2.5  2.   3.1  5.4  0.7  1.4  3.1  2.   3.4  5.5  3.8  5.5
    3.7  6.4  9.1  5.8  4.1  2.4  7.5  8.3  5.6  9.7  9.1 11.2 13.9 18.7
    6.2 13.2 30.  21.6]