@staticmethod
def getParam(waveforms, param='Amp', t=200, fet=1):
    "\n        Returns the requested parameter from a spike train as a numpy array\n\n        Parameters\n        -------------------\n\n        waveforms - numpy array\n            Shape of array can be an nSpikes x nSamples\n            OR\n            a nSpikes x nElectrodes x nSamples\n\n        param - str\n            Valid values are:\n                'Amp' - peak-to-trough amplitude (default)\n                'P' - height of peak\n                'T' - depth of trough\n                'Vt' height at time t\n                'tP' - time of peak (in seconds)\n                'tT' - time of trough (in seconds)\n                'PCA' - first n fet principal components (defaults to 1)\n\n        t - int\n            The time used for Vt\n\n        fet - int\n            The number of principal components (used with param 'PCA')\n        "
    from scipy import interpolate
    from sklearn.decomposition import PCA
    if (param == 'Amp'):
        return np.ptp(waveforms, axis=(- 1))
    elif (param == 'P'):
        return np.max(waveforms, axis=(- 1))
    elif (param == 'T'):
        return np.min(waveforms, axis=(- 1))
    elif (param == 'Vt'):
        times = np.arange(0, 1000, 20)
        f = interpolate.interp1d(times, range(50), 'nearest')
        if (waveforms.ndim == 2):
            return waveforms[:, int(f(t))]
        elif (waveforms.ndim == 3):
            return waveforms[:, :, int(f(t))]
    elif (param == 'tP'):
        idx = np.argmax(waveforms, axis=(- 1))
        m = interpolate.interp1d([0, (waveforms.shape[(- 1)] - 1)], [0, (1 / 1000.0)])
        return m(idx)
    elif (param == 'tT'):
        idx = np.argmin(waveforms, axis=(- 1))
        m = interpolate.interp1d([0, (waveforms.shape[(- 1)] - 1)], [0, (1 / 1000.0)])
        return m(idx)
    elif (param == 'PCA'):
        pca = PCA(n_components=fet)
        if (waveforms.ndim == 2):
            return pca.fit(waveforms).transform(waveforms).squeeze()
        elif (waveforms.ndim == 3):
            out = np.zeros((waveforms.shape[0], (waveforms.shape[1] * fet)))
            st = np.arange(0, (waveforms.shape[1] * fet), fet)
            en = np.arange(fet, (fet + (waveforms.shape[1] * fet)), fet)
            rng = np.vstack((st, en))
            for i in range(waveforms.shape[1]):
                if (~ np.any(np.isnan(waveforms[:, i, :]))):
                    A = np.squeeze(pca.fit(waveforms[:, i, :].squeeze()).transform(waveforms[:, i, :].squeeze()))
                    if (A.ndim < 2):
                        out[:, rng[(0, i)]:rng[(1, i)]] = np.atleast_2d(A).T
                    else:
                        out[:, rng[(0, i)]:rng[(1, i)]] = A
            return out
Returns the requested parameter from a spike train as a numpy array

Parameters
-------------------

waveforms - numpy array
    Shape of array can be an nSpikes x nSamples
    OR
    a nSpikes x nElectrodes x nSamples

param - str
    Valid values are:
        'Amp' - peak-to-trough amplitude (default)
        'P' - height of peak
        'T' - depth of trough
        'Vt' height at time t
        'tP' - time of peak (in seconds)
        'tT' - time of trough (in seconds)
        'PCA' - first n fet principal components (defaults to 1)

t - int
    The time used for Vt

fet - int
    The number of principal components (used with param 'PCA')
@staticmethod
def getParam(waveforms, param='Amp', t=200, fet=1):
    "\n        Returns the requested parameter from a spike train as a numpy array\n\n        Parameters\n        -------------------\n\n        waveforms - numpy array\n            Shape of array can be an nSpikes x nSamples\n            OR\n            a nSpikes x nElectrodes x nSamples\n\n        param - str\n            Valid values are:\n                'Amp' - peak-to-trough amplitude (default)\n                'P' - height of peak\n                'T' - depth of trough\n                'Vt' height at time t\n                'tP' - time of peak (in seconds)\n                'tT' - time of trough (in seconds)\n                'PCA' - first n fet principal components (defaults to 1)\n\n        t - int\n            The time used for Vt\n\n        fet - int\n            The number of principal components (used with param 'PCA')\n        "
    from scipy import interpolate
    from sklearn.decomposition import PCA
    if (param == 'Amp'):
        return np.ptp(waveforms, axis=(- 1))
    elif (param == 'P'):
        return np.max(waveforms, axis=(- 1))
    elif (param == 'T'):
        return np.min(waveforms, axis=(- 1))
    elif (param == 'Vt'):
        times = np.arange(0, 1000, 20)
        f = interpolate.interp1d(times, range(50), 'nearest')
        if (waveforms.ndim == 2):
            return waveforms[:, int(f(t))]
        elif (waveforms.ndim == 3):
            return waveforms[:, :, int(f(t))]
    elif (param == 'tP'):
        idx = np.argmax(waveforms, axis=(- 1))
        m = interpolate.interp1d([0, (waveforms.shape[(- 1)] - 1)], [0, (1 / 1000.0)])
        return m(idx)
    elif (param == 'tT'):
        idx = np.argmin(waveforms, axis=(- 1))
        m = interpolate.interp1d([0, (waveforms.shape[(- 1)] - 1)], [0, (1 / 1000.0)])
        return m(idx)
    elif (param == 'PCA'):
        pca = PCA(n_components=fet)
        if (waveforms.ndim == 2):
            return pca.fit(waveforms).transform(waveforms).squeeze()
        elif (waveforms.ndim == 3):
            out = np.zeros((waveforms.shape[0], (waveforms.shape[1] * fet)))
            st = np.arange(0, (waveforms.shape[1] * fet), fet)
            en = np.arange(fet, (fet + (waveforms.shape[1] * fet)), fet)
            rng = np.vstack((st, en))
            for i in range(waveforms.shape[1]):
                if (~ np.any(np.isnan(waveforms[:, i, :]))):
                    A = np.squeeze(pca.fit(waveforms[:, i, :].squeeze()).transform(waveforms[:, i, :].squeeze()))
                    if (A.ndim < 2):
                        out[:, rng[(0, i)]:rng[(1, i)]] = np.atleast_2d(A).T
                    else:
                        out[:, rng[(0, i)]:rng[(1, i)]] = A
            return out