1 from frictionImports
import sys, os, plt, np
2 from frictionImports
import *
4 python_path = os.path.dirname(os.path.realpath(__file__))
6 colors_diverging_short = [
'#d7191c',
'#fdae61',
'#ffffbf',
'#abd9e9',
'#2c7bb6']
7 colors_diverging_long = [
'#a50026',
'#d73027',
'#f46d43',
'#fdae61',
'#fee090',
'#ffffbf',
'#e0f3f8',
'#abd9e9',
'#74add1',
'#4575b4',
'#313695']
8 colors_qualitative_short = [
'#1b9e77',
'#d95f02',
'#7570b3',
'#e7298a',
'#66a61e']
9 colors_qualitative_long = [
'#1b9e77',
'#d95f02',
'#7570b3',
'#e7298a',
'#66a61e',
'#e6ab02',
'#a6761d']
10 linestyles = [
'-',
'--',
'-.',
':']
14 general_path = python_path +
"/../../../results/CI_amplitude_plots/" 15 paths = [
"average_bk_increase_16_runs.csv",
"average_bkp_increase_16_runs.csv",
"average_bk_decrease_16_runs.csv",
"average_bkp_decrease_16_runs.csv"]
16 labels = [
"BK: increase",
"BK-Pad: increase",
"BK: decrease",
"BK-Pad: decrease"]
17 amplitude_files = np.array([np.loadtxt(general_path + path, delimiter =
",")
for path
in paths])
19 colors = colors_qualitative_long
21 for i, amplitude_file
in enumerate(amplitude_files):
22 plt.plot(amplitude_file[0], amplitude_file[1], color=colors[i], label=labels[i], linestyle=linestyles[i])
23 plt.fill_between(amplitude_file[0], amplitude_file[1] + amplitude_file[2], amplitude_file[1] - amplitude_file[2], color = colors[i], alpha=.5)
25 plt.legend(title=
"Model: run type")
27 if(
"-log" in sys.argv):
37 phi = F_0 * ((1 - sigma)/(1 + np.abs(y)/(1 - sigma)) * np.sign(y))
43 general_path = python_path +
"/../../../results/week_20/average_model_plots/" 44 paths = [
"bk_increasing/results/average_16_runs.csv",
"bkp_increasing/results/average_16_runs.csv",
"bk_decreasing/results/average_16_runs.csv",
"bkp_decreasing/results/average_16_runs.csv"]
45 labels = [
"BK: inc.",
"BK-Pad: inc.",
"BK: dec.",
"BK-Pad: dec."]
46 amplitude_files = np.array([np.loadtxt(general_path + path, delimiter =
",")
for path
in paths])
48 colors = colors_qualitative_long
49 ecolors = colors_diverging_long
54 for i, amplitude_file
in enumerate(amplitude_files):
55 if(len(amplitude_file) > 3):
57 plt.plot(amplitude_file[0], abs(amplitude_file[3]), color=colors[i], linestyle=linestyles[i % 4])
59 plt.errorbar(amplitude_file[0], amplitude_file[1], yerr=amplitude_file[2], ecolor=ecolors[-i], label=labels[i], color=colors[i], linestyle=linestyles[i % 4])
62 plt.plot(amplitude_files[0][0], phi*100, label=
"\$\phi(\\nu)*N\$", color=colors[-1])
64 plt.legend(title=
"Model: type")
66 plt.xlabel(
"\$\\nu\$")
67 plt.suptitle(
"Averaged BK/BKP runs")
69 if(
"-log" in sys.argv):
75 if(
"--average" in sys.argv):
81 if __name__ ==
"__main__":
def plotAveragedAmplitudes()
def frictionLaw(y, sigma=0.01, F_0=1)