From 8817ed4b4ca667f77ca2b45b9320fa98a58022fd Mon Sep 17 00:00:00 2001 From: yeye Date: Fri, 9 Jul 2021 15:22:23 +0200 Subject: [PATCH] new figures: paper --- kalman/graphics/figure_func.py | 37 +++++ kalman/graphics/figure_func2.py | 170 +++++++++++++++++++++++ kalman/input_files/aorta.yaml | 50 +++---- kalman/input_files/aorta_old.yaml | 209 ----------------------------- kalman/input_files/aorta_old2.yaml | 209 ----------------------------- 5 files changed, 233 insertions(+), 442 deletions(-) create mode 100644 kalman/graphics/figure_func.py create mode 100644 kalman/graphics/figure_func2.py delete mode 100755 kalman/input_files/aorta_old.yaml delete mode 100755 kalman/input_files/aorta_old2.yaml diff --git a/kalman/graphics/figure_func.py b/kalman/graphics/figure_func.py new file mode 100644 index 0000000..d6f06de --- /dev/null +++ b/kalman/graphics/figure_func.py @@ -0,0 +1,37 @@ +import matplotlib.pyplot as plt +import numpy as np +from itertools import cycle +import argparse +import pickle +import yaml + + +from matplotlib import rc +rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']}) +rc('text', usetex=True) + + +u = np.linspace(-2,2,100) +utrue = 1 +venc1 = 0.9*utrue +venc2 = 0.6*utrue + +fig1, ax1 = plt.subplots(1,1,figsize=(8, 5)) + +J1 = 1 - np.cos((utrue-u)/venc1*np.pi) +J2 = 1 - np.cos((utrue-u)/venc2*np.pi) + + +lwidth = 2 +font_size = 28 + +ax1.plot(u, J1, color = 'orangered', label = '$venc = 0.9 u_{true}$', linestyle='-',linewidth=lwidth) +ax1.plot(u, J2, color = 'dodgerblue', label = '$venc = 0.6 u_{true}$', linestyle='-',linewidth=lwidth) +ax1.axvline(x=1,color = 'black',linewidth = lwidth , label = '$u_{true}$') + +ax1.legend(fontsize=20, loc= 'upper right') +ax1.tick_params(axis='both', which='major', labelsize=22) +ax1.set_yticks([]) +ax1.set_xlabel('$u$',fontsize=font_size) +plt.show() +fig1.savefig('functionals.png', dpi=500, bbox_inches='tight') \ No newline at end of file diff --git a/kalman/graphics/figure_func2.py b/kalman/graphics/figure_func2.py new file mode 100644 index 0000000..9afcd10 --- /dev/null +++ b/kalman/graphics/figure_func2.py @@ -0,0 +1,170 @@ +import matplotlib.pyplot as plt +import numpy as np +from itertools import cycle +import argparse +import pickle +import yaml + + +from matplotlib import rc +rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']}) +rc('text', usetex=True) + + +fig1, ax1 = plt.subplots(1,1,figsize=(8, 5)) +lwidth = 2 +font_size = 28 + +################ Flow Parameters +Rd = 2.5 +Rt = 0.5 +GradP = 4 +mu = 0.5 +fac = 1 +nr = 50 +VENC = 0.6 + +gamma = 267.513e6 # rad/Tesla/sec Gyromagnetic ratio for H nuclei +Bo = 1.5 # Tesla Magnetic Field Strenght +TE = 5e-3 # Echo-time +M = np.ones(nr) # Magnetization +phi0 = gamma*Bo*TE # Reference phase +phi02 = phi0%3.14 +M1 = np.pi/(gamma*VENC) +ff = np.pi/(1000*gamma*M1) +uv = np.arange(-4*VENC,4*VENC,ff) + + +r = np.linspace(-Rd, Rd, nr) +dr = r[2]-r[1] +vmax = 1 +v = vmax/Rt**2*( Rt**2 - r**2 )*(np.abs(r)0.8) + (t<1.6)*(0.8+Th1.6) + (t<2.4)*(1.6+Th0.8) + (t<1.6)*(0.8+Th1.6) + (t<2.4)*(1.6+Th