Beispiel #1
0
mkdir(dir2X)
sim_coef = 0.9
#endFName = '_P_%.2f_f0_%.2f.npy' %(p1,p2)
endFName = '_P_%.2f_G_%.2f.npy' % (p1, p2)
fileName = 'patterns' + endFName

############################################################################################'
# **Main**
if not adressExists(dir2X + fileName):
    tic()
    pattsX = data2array(dir1X + fileName,
                        mmap_mode="r+")  #.reshape((3300,998))
    pattsS = data2array(dir1S + fileName,
                        mmap_mode="r+")  #.reshape((3300,998))
    patts = pattsX  #!!!

    S = sortBy(patts.mean(1) - patts.mean(), inverse=1)[0]
    C1, freq = preClustering(patts[S],
                             sim_coef=sim_coef,
                             sim_func=similarity_Euclidean)
    C2, freq = preClustering(patts[S][C1],
                             freq=freq,
                             sim_coef=sim_coef,
                             sim_func=fPearsonCorrelation)
    SC, freq = sortBy(freq, inverse=1)

    array2data(pattsX[S][C1][C2][SC], dir2X + fileName)
    array2data(pattsS[S][C1][C2][SC], dir2S + fileName)
    array2data(freq, dir2X + '/tendances' + endFName)
    tac()
Beispiel #2
0
        'tauT': 80,
        'P': P,
        'G': 900.,
    }

    noise = {'stdD_x': sx, 'stdD_T': sT, 'colors': ['white', 'white']}

    out = ['x']

    other = {'init': 'rand', 'dens': 0.5, 'rperiod': 100, 'dur': '20m'}

    eva = main.evaCure(evaCon=conn,
                       evaNoi=noise,
                       evaMod=model,
                       out=out,
                       **other)
    eva.updateTillEnd()
    TC = eva.out['x']
    array2data(TC, dir_TC + '/TC_998_' + name)

if not adressExists(dir_FC + '/FC_998_' + name):
    try:
        TC = array(TC)
    except:
        TC = data2array(dir_TC + '/TC_998_' + name)

    tic()
    FC = fPearsonCorrelation(TC)
    tac('h')
    array2data(FC, dir_FC + '/FC_998_' + name)