8 from __future__
import division,unicode_literals
10 from math
import radians,cos,sin,tan,pi,sqrt
11 import matplotlib.pyplot
as plt
12 from mpl_toolkits.mplot3d
import Axes3D
13 from matplotlib
import cm
14 import matplotlib.animation
as animation
20 data=numpy.loadtxt(path+
'filmthickness.csv')
21 time,dr,np,vt,fs,hmin,hloc,hcenter,havg=\
22 numpy.loadtxt(path+
'results_1d.csv',skiprows=1,unpack=
True)
25 for i
in range(points):
26 radius.append(dr[0]*(0.5+i))
28 radius=numpy.array(radius)
32 xran=int(len(radius)*xpart)
33 fig = plt.figure(figsize=(10.0,8.0))
34 plt.rc(
'xtick', labelsize=fontsize)
35 plt.rc(
'ytick', labelsize=fontsize)
36 for i
in range(nlines):
37 j=int((len(time)-1)/(nlines-1)*i)
39 radius[k]=dr[j]*(0.5+k)
40 line1,=plt.plot(radius[0:xran]*1e6,data[j][0:xran]*1e6,
41 label=
't={0:g} s'.format(time[j]),lw=linewidth)
44 plt.legend(loc=2, fontsize=fontsize)
45 plt.xlabel(
'Distance from center (μm)', fontsize=fontsize)
46 plt.ylabel(
'Film half thickness (μm)', fontsize=fontsize)
48 plt.savefig(
'profiles.pdf')
54 times=[0,int(len(data)/10),len(data)-1]
55 fig = plt.figure(figsize=(10.0,10.0))
56 plt.rc(
'xtick', labelsize=fontsize)
57 plt.rc(
'ytick', labelsize=fontsize)
60 radius[k]=dr[j]*(0.5+k)
62 plt.xlim(-Rc/sqrt(3.0)*1e6,Rc*1e6)
63 plt.ylim(-Rc*1e6,Rc*1e6)
64 for i,j
in enumerate(times):
67 radius[k]=dr[j]*(0.5+k)
70 y0=data[times[i]][0:xran]
73 d=(x0+a*(y0-c))/(1+a**2)
74 x1=2*d-x0+Rc+data[times[i]][-1]*tan(pi/6)
78 d=(x1+a*(y1-c))/(1+a**2)
83 x1=numpy.append(x1,x2)
84 y1=numpy.append(y1,y2)
86 line1,=plt.plot(x1*1e6,y1*1e6,color=colors[i],
87 label=
't={0:g} s'.format(time[times[i]]),lw=linewidth)
89 line1,=plt.plot(x1*1e6,y1*1e6,color=colors[i],lw=linewidth)
92 d=(x1+a*(y1-c))/(1+a**2)
96 line2,=plt.plot(x2*1e6,y2*1e6,color=colors[i],
97 label=
't={0:g} s'.format(time[times[i]]),lw=linewidth)
99 line2,=plt.plot(x2*1e6,y2*1e6,color=colors[i],lw=linewidth)
102 d=(x1+a*(y1-c))/(1+a**2)
106 line3,=plt.plot(x3*1e6,y3*1e6,color=colors[i],
107 label=
't={0:g} s'.format(time[times[i]]),lw=linewidth)
109 line3,=plt.plot(x3*1e6,y3*1e6,color=colors[i],lw=linewidth)
110 plt.legend(loc=1, fontsize=fontsize)
111 plt.xlabel(
'Dimensions in (μm)', fontsize=fontsize)
112 plt.ylabel(
'Dimensions in (μm)', fontsize=fontsize)
114 plt.savefig(
'profiles2d.pdf')
118 fig = plt.figure(figsize=(5.0,4.0))
119 ax = fig.gca(projection=
'3d')
120 radius3d, time3d = numpy.meshgrid(radius, time)
121 surf = ax.plot_surface(time3d, radius3d*1e6, data*1e6, rstride=1, cstride=1, cmap=cm.coolwarm, linewidth=0, antialiased=
False)
130 plt.savefig(
'profiles3d.png')
134 for k
in range(xran):
135 radius[k]=dr[j]*(0.5+k)
136 fig,ax = plt.subplots(figsize=(10.0,8.0))
137 ax.set_xlim(radius[0]*1e6, (radius[-1]+dr[0]/2)*1e6)
138 ax.set_ylim(0, max(map(max,data))*1e6)
139 line,=ax.plot(radius[0:xran]*1e6,data[0][0:xran]*1e6,
140 label=
't={0:.1e} s'.format(time[0]),lw=linewidth)
141 plt.rc(
'xtick', labelsize=fontsize)
142 plt.rc(
'ytick', labelsize=fontsize)
143 plt.legend(loc=2, fontsize=fontsize)
144 plt.xlabel(
'position', fontsize=fontsize)
145 plt.ylabel(
'half thickness (um)', fontsize=fontsize)
151 if iii[0]>len(time)-1:
153 plt.legend([
't={0:.1e} s'.format(time[iii[0]])], loc=2, fontsize=fontsize)
154 for k
in range(xran):
155 radius[k]=dr[iii[0]]*(0.5+k)
156 line.set_xdata(radius[0:xran]*1e6)
157 line.set_ydata(data[iii[0]][0:xran]*1e6)
161 while True:
yield data[0][0:xran]*1e6
165 ani=animation.FuncAnimation(fig,update,data_gen,interval=100)
170 print 'saving of animation not implemented'