2023-09-30 17:53:06 +00:00
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
"""
|
|
|
|
|
Created on Tue Aug 30 14:25:12 2022
|
|
|
|
|
|
2023-12-14 19:49:44 +00:00
|
|
|
|
@author: timofej
|
2023-09-30 17:53:06 +00:00
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
import sys
|
|
|
|
|
import os
|
|
|
|
|
import json
|
|
|
|
|
|
|
|
|
|
from plot import qtplot
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import math as m
|
|
|
|
|
import numpy as np
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vect = np.vectorize
|
|
|
|
|
|
|
|
|
|
@vect
|
|
|
|
|
def log2(x):
|
|
|
|
|
try:
|
|
|
|
|
return m.log2(x)
|
|
|
|
|
except ValueError:
|
|
|
|
|
if x==0:
|
|
|
|
|
return float(0)
|
|
|
|
|
else:
|
|
|
|
|
raise
|
|
|
|
|
|
|
|
|
|
def new_folder(path):
|
|
|
|
|
if not os.path.exists(path):
|
|
|
|
|
os.makedirs(path)
|
|
|
|
|
return path
|
|
|
|
|
|
|
|
|
|
path = '/cloud/Public/_data/neuropercolation/4lay/cons=27-knight_steps=100100_causal/dim=09/batch=0/'
|
|
|
|
|
suffix = ''
|
|
|
|
|
|
|
|
|
|
chi = chr(967)
|
|
|
|
|
vareps = chr(949)
|
|
|
|
|
|
|
|
|
|
vals = [[],[]]
|
|
|
|
|
|
|
|
|
|
runsteps = 1000100
|
|
|
|
|
|
|
|
|
|
eps_space = np.linspace(0.005, 0.5, 100)
|
|
|
|
|
eps_space = eps_space[1::2]
|
|
|
|
|
|
|
|
|
|
dims = list(range(3,10))#+[16,49]
|
|
|
|
|
|
|
|
|
|
mode='density'
|
|
|
|
|
ma=[]
|
|
|
|
|
s=[]
|
|
|
|
|
k=[]
|
|
|
|
|
mk=[]
|
|
|
|
|
lastkurt=None
|
|
|
|
|
for dim in dims[-1:]:
|
|
|
|
|
dimpath = new_folder(path + f'dim={dim:02}/')
|
|
|
|
|
for epsilon in eps_space[:]:
|
|
|
|
|
with open(path+f"eps={round(epsilon,3):.3f}_phase_diff.txt", 'r', encoding='utf-8') as f:
|
|
|
|
|
phase_diff = np.array(json.load(f)[:500])
|
|
|
|
|
with open(path+f"eps={round(epsilon,3):.3f}_ei.txt", 'r', encoding='utf-8') as f:
|
|
|
|
|
phase_diff = np.array(json.load(f)[:500])
|
|
|
|
|
|
|
|
|
|
qtplot(f"Phase relation time series for eps={round(epsilon,3):.3f}",
|
|
|
|
|
[list(range(500))]*2,
|
|
|
|
|
[phase_diff],
|
|
|
|
|
x_tag = 'time step',
|
|
|
|
|
y_tag = f'phase diffe´rence',
|
|
|
|
|
y_range = (-m.pi,m.pi),
|
|
|
|
|
export=True,
|
|
|
|
|
path=dimpath+"evolution/",
|
|
|
|
|
filename=f'eps={round(epsilon,3):.3f}_evolution.png',
|
|
|
|
|
close=False)
|
|
|
|
|
|
|
|
|
|
mode = 'density'
|
|
|
|
|
#%%
|