Skip to content
Snippets Groups Projects

params/mirrors cleaning + usable test suite (issues #11 and #10)

Merged Boman Romain requested to merge testsuite into master
2 files
+ 29
19
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 14
11
@@ -6,20 +6,18 @@ import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from fwk.wutils import parseargs
args = parseargs()
fig, ax = plt.subplots()
SIZE=200
SIZE = 200
ez = np.zeros(SIZE, dtype=float)
hy = np.zeros(SIZE, dtype=float)
imp0 = 377.0
maxTime = 1000
maxTime = 300
nloop = 1
#
args = parseargs()
if not args.nogui:
fig, ax = plt.subplots()
line, = plt.plot(ez)
plt.title('Example p42')
plt.xlabel('X')
@@ -28,6 +26,8 @@ if not args.nogui:
plt.ylim(-1,1)
plt.grid(True)
plt.draw()
else:
line = None
qTime=0
def animate(i):
@@ -60,14 +60,17 @@ def animate(i):
# correction for TFSF boundary
ez[50] += np.exp(-(qTime+0.5- (-0.5) - 30.)*(qTime+0.5- (-0.5) - 30.)/100.)
if not args.nogui:
line.set_ydata(ez)
ax.set_title('time = %d' % qTime)
line.set_ydata(ez)
ax.set_title('time = %d' % qTime)
return line,
#
args = parseargs()
if not args.nogui:
ani = animation.FuncAnimation(fig, animate, maxTime // nloop,
interval=25, repeat=False)
plt.show()
\ No newline at end of file
plt.show()
else:
# calls the loops without matplotlib
for i in xrange(maxTime // nloop):
animate(i)
\ No newline at end of file
Loading