Beispiel #1
0
def peak_minima(x, s):
    s0 = p.ps(s, p0=x[0] * 18000, p1=x[1] * 18000)
    s = np.real(s0).flatten()

    i = np.argmax(s)
    peak = s[i]
    mina = np.min(s[i - 100:i])
    minb = np.min(s[i:i + 100])

    return np.abs(mina - minb)
Beispiel #2
0
def peak_minima(x, s):
    s0 = p.ps(s, p0=x[0]*18000, p1=x[1]*18000)
    s = np.real(s0).flatten()

    i = np.argmax(s)
    peak = s[i]
    mina = np.min(s[i - 100:i])
    minb = np.min(s[i:i + 100])

    return np.abs(mina - minb)
Beispiel #3
0
def min_entropy(x, data):
    if data.ndim > 1:
        return gmean([min_entropy(x, row) for row in data])

    _data = p.ps(data, p0=x[0] * 18000, p1=x[1] * 18000).real
    drv = np.absolute(np.diff(_data))
    hst = drv / sum(drv)
    g = np.ptp(data.real)
    penalty = np.sum(_data[_data < 0]**2) * g

    entropy = np.sum(hst * np.log(hst)) + penalty
    return entropy
Beispiel #4
0
def min_entropy(x, data):
    if data.ndim > 1:
        return gmean([min_entropy(x, row) for row in data])
    
    _data = p.ps(data,p0=x[0]*18000, p1=x[1]*18000).real
    drv = np.absolute(np.diff(_data))
    hst = drv / sum(drv)
    g = np.ptp(data.real)
    penalty = np.sum( _data[_data<0]**2 ) * g
    
    entropy = np.sum(hst * np.log(hst)) + penalty
    return entropy
Beispiel #5
0
def whiten(x, data):
    a = np.abs(p.ps(data, p0=x[0] * 18000, p1=x[1] * 18000).real)
    t = float(np.mean(a))
    return np.sum(a > t)
Beispiel #6
0
def min_point(x, data):
    obj = -p.ps(data, p0=x[0] * 18000, p1=x[1] * 18000).real.min()
    return obj
Beispiel #7
0
def max_integ(x, data):
    integ = np.trapz(p.ps(data, p0=x[0] * 18000, p1=x[1] * 18000).real)
    for i in range(1, data.udic['ndim']):
        integ = np.trapz(integ)
    return -integ
Beispiel #8
0
def whiten(x, data):
    a = np.abs(p.ps(data, p0=x[0]*18000, p1=x[1]*18000).real)
    t = float(np.mean(a))
    return np.sum(a > t)
Beispiel #9
0
def min_point(x, data):
    obj = -p.ps(data,p0=x[0]*18000, p1=x[1]*18000).real.min()
    return obj
Beispiel #10
0
def max_integ(x, data):
    integ = np.trapz(p.ps(data, p0=x[0]*18000, p1=x[1]*18000).real)
    for i in range(1,data.udic['ndim']): integ = np.trapz(integ)
    return -integ