del sys.argv[1] if option == '-p1': p1 = float(sys.argv[1].replace(',', '.')) del sys.argv[1] elif option == '-p2': p2 = float(sys.argv[1].replace(',', '.')) del sys.argv[1] elif option == '-p3': p3 = str(sys.argv[1]) del sys.argv[1] else: print 'Options invalides :', option, '->', sys.argv[0] main = '/home/mathieuG/SearchForPatt/%s' % p3 typ2 = '_pC' mkdir(main + typ2) dir1S = main + '/Cand_S/' dir1X = main + '/Cand_X/' dir2S = main + typ2 + '/Cand_S/' dir2X = main + typ2 + '/Cand_X/' mkdir(dir2S) 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()
# **Parameters** while len(sys.argv) > 1: option = sys.argv[1]; del sys.argv[1] if option == '-G': G = float(sys.argv[1].replace(',','.')); del sys.argv[1] elif option == '-sx': sx = float(sys.argv[1].replace(',','.')); del sys.argv[1] elif option == '-sT': sT = float(sys.argv[1].replace(',','.')); del sys.argv[1] elif option == '-dir': dir_= str(sys.argv[1]); del sys.argv[1] else: print 'Options invalides :',option,'->',sys.argv[0] mdir = '/home/mathieuG/TCS/%s' %dir_ name = 'G_%.2f_sx_%.3f_sT_%.3f.npy' %(G, sx, sT) dir_DFC = mdir + '/DFC_998/' dir_TC = mdir + '/TC_998/' try: mkdir(dir_DFC) except: pass ############################################################################################' # **Main** if not adressExists(dir_DFC + name): TC = data2array(dir_TC + name) FCs = windowedFCs(TC, window=6000, jump=100) DFC = windowedCorrelations(FCs) array2data(DFC, dir_DFC + name)
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], dir_prix + '/patterns_' + endDir) array2data(pattsA[S][C1][C2][SC], dir_priA + '/patterns_' + endDir) array2data(freq, dir_priT + '/tendances_' + endDir) os.system('rm ' + dir_prix + '/allPatt_' + endDir) os.system('rm ' + dir_priA + '/allPatt_' + endDir) return len(pattsx[S][C1][C2][SC]) ############################################################################################' # **Main** dir_sub = '/dP_G_%.3f_r_%i.npy' %(G, revert) if not adressExists(dir_priC + dir_sub): mkdir(dir_prix) mkdir(dir_priA) mkdir(dir_priT) mkdir(dir_priC) if revert: x = [0.95, 2.00] else: x = [0.00, 1.05] dx = paramExplo(funcNbofAttr, nb=[7,1], ax='x', x=x, y=[G], revert=revert) array2data(dx, dir_priC + dir_sub)
# **Parameters** while len(sys.argv) > 1: option = sys.argv[1] del sys.argv[1] if option == '-p1': p1 = float(sys.argv[1].replace(',', '.')) del sys.argv[1] elif option == '-p2': p2 = float(sys.argv[1].replace(',', '.')) del sys.argv[1] else: print 'Options invalides :', option, '->', sys.argv[0] dir_priA = './withG_SG/Cand_S' dir_prix = './withG_SG/Cand_X' mkdir(dir_priA) mkdir(dir_prix) #dir_sub = '/patterns_P_%.2f_f0_%.2f.npy' %(p1,p2) dir_sub = '/patterns_P_%.2f_G_%.2f.npy' % (p1, p2) ############################################################################################' # **Main** multi_dens = arange(0.02, 0.981, 0.03) # (33) all_pattx = zeros((3300, 998)) all_pattA = zeros((3300, 998)) conn = {'connAd': Pdir('Connectomes/SC_FB_D_998_0.npy'), 'normType': '1'} noise = {'colors': None} model = {
elif option == '-sT': sT = float(sys.argv[1].replace(',', '.')) del sys.argv[1] elif option == '-dir': dir_ = str(sys.argv[1]) del sys.argv[1] else: print 'Options invalides :', option, '->', sys.argv[0] mdir = '/home/mathieuG/TCS/%s' % dir_ name = 'P_%.2f_sigmax_%.2f.npy' % (P, sx) dir_FC = mdir + '/FC_998' dir_TC = mdir + '/TC_998' try: mkdir(dir_FC) mkdir(dir_TC) except: pass ############################################################################################' # **Main** if not adressExists(dir_TC + '/TC_998_' + name): conn = { 'connAd': "/home/mathieuG/Connectomes/Hagmann/SC_D_998_0.npy", 'normC': 1. } model = { 'model': 'HopfieldBasedDynamic',