Skip to content
Snippets Groups Projects
Commit cb12b23d authored by Maximilian Schmidt's avatar Maximilian Schmidt
Browse files

Remove dependence of seaborn from SchueckerSchmidt2017 scripts

parent c3a7c534
No related branches found
No related tags found
1 merge request!1Add all necessary files for the multi-area model
......@@ -5,8 +5,6 @@ from multiarea_model import MultiAreaModel
from multiarea_model.multiarea_helpers import create_vector_mask
from multiarea_model.stabilize import stabilize
import utils
import seaborn as sns
cp = sns.color_palette()
"""
Initialization
......@@ -68,7 +66,8 @@ for iteration in [1, 2, 3, 4, 5]:
# Scan parameter space to find a good approximation of the
# critical parameter value where the model crosses the
# separatrix for the initial condition of zero rates
if iteration < 5: # For iteration 5, we just analyze the behavior without performing the stabilization
if iteration < 5:
# For iteration 5, we just analyze the behavior without performing the stabilization
data[iteration] = utils.compute_iteration(7, fac_nu_ext_5E_list,
theory_params, M_base, threads=THREADS)
else:
......
......@@ -53,15 +53,12 @@ def velocity_peaks(time, result, threshold=0.05):
def plot_iteration(results, theory_params, threshold=0.05, full=True):
import seaborn as sns
traj = np.mean(results, axis=1)
if full:
ind = list(range(0, len(traj)))
else:
i = np.argmax(np.diff(traj[:, -1]))
ind = [i, i+1]
cp = sns.color_palette(n_colors=len(ind))
time = np.arange(0., theory_params['T'], theory_params['dt'])
fig = pl.figure()
......@@ -76,13 +73,13 @@ def plot_iteration(results, theory_params, threshold=0.05, full=True):
ax = fig.add_subplot(122)
for n, i in enumerate(ind):
d_nu, minima = velocity_peaks(time, results[i], threshold=threshold)
ax.plot(time[:-1], d_nu, color=cp[n])
ax.plot(time[:-1], d_nu)
if not full:
ax.vlines(time[minima],
1e-6,
1e0,
linestyles='dashed',
color=cp[n])
color='k')
ax.set_yscale('Log')
pl.show()
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment