• R/O
  • SSH

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisioncd60708cc67ba974922993fe1e74d3c4dd5dd051 (tree)
Zeit2007-12-04 21:34:22
Autoriselllo
Commiteriselllo

Log Message

I added test-section2.py, basically the same as test-section.py but it
also shows how to read files from the output of the DNS code.

Ändern Zusammenfassung

Diff

diff -r 88cc5e8bb2bf -r cd60708cc67b Python-codes/test-section2.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Python-codes/test-section2.py Tue Dec 04 12:34:22 2007 +0000
@@ -0,0 +1,54 @@
1+#! /usr/bin/env python
2+from scipy import *
3+import pylab
4+
5+nt=129
6+nr=88
7+nz=129
8+read3d=0
9+
10+if (read3d!=0):
11+ vel3d=pylab.load("vsection")
12+ print 'the shape of vel3d is', shape(vel3d)
13+ vel3d=vel3d.reshape(nt,nr,nz)
14+ vel_section=vel3d[:,:,65]
15+ pylab.save("vel_cross_section",vel_section)
16+
17+elif (read3d==0):
18+ vel_section=pylab.load("vel_cross_section")
19+
20+rg2=pylab.load("rg2.out")
21+r=rg2[:,0]
22+
23+
24+theta=linspace(0.,2.*pi,nt)
25+#print "theta is ", theta
26+sin_t=sin(theta)
27+cos_t=cos(theta)
28+rsin_t=r[newaxis,:]*sin_t[:,newaxis]
29+rcos_t=r[newaxis,:]*cos_t[:,newaxis]
30+rsin_t=ravel(rsin_t)
31+rcos_t=ravel(rcos_t)
32+
33+rsin_t.shape=(nt,nr)
34+rcos_t.shape=(nt,nr)
35+
36+
37+#pylab.colorbar()
38+#pylab.clf()
39+pylab.figure()
40+X = rsin_t.transpose()
41+Y = rcos_t.transpose()
42+Z = vel_section.transpose()
43+velmin = vel_section.min()
44+velmax = vel_section.max()
45+print velmin, velmax
46+levels = arange(velmin, velmax+0.01, 0.01)
47+pylab.contourf(X, Y, Z, levels, cmap=pylab.cm.jet)
48+pylab.colorbar()
49+
50+#pylab.show()
51+
52+pylab.savefig("velocity_on_section_DNS.png")
53+#pylab.hold(False)
54+