Revision | b67ef8b1139cf8f82a9891c05c19f2d13725fd19 (tree) |
---|---|
Zeit | 2007-07-26 06:38:32 |
Autor | iselllo |
Commiter | iselllo |
I removed the first plot from the code plot_section.py and now the plot
of the scalar (namely the axial velocity) along a cross section is fine.
@@ -8,30 +8,18 @@ | ||
8 | 8 | read3d=0 |
9 | 9 | |
10 | 10 | if (read3d!=0): |
11 | - | |
12 | - vel3d=pylab.load("vsection") | |
13 | - print 'the shape of vel3d is', shape(vel3d) | |
14 | - vel3d=vel3d.reshape(nt,nr,nz) | |
15 | - vel_section=vel3d[:,:,65] | |
16 | - pylab.save("vel_cross_section",vel_section) | |
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) | |
17 | 16 | |
18 | 17 | elif (read3d==0): |
19 | - vel_section=pylab.load("vel_cross_section") | |
18 | + vel_section=pylab.load("vel_cross_section") | |
20 | 19 | |
21 | 20 | rg2=pylab.load("rg2.out") |
22 | 21 | r=rg2[:,0] |
23 | 22 | |
24 | -pylab.hold(False) | |
25 | -# the following plot is just a test to make sure I can read the cross-section file correctly | |
26 | -pylab.plot(r,vel_section[34,:]) | |
27 | - | |
28 | -pylab.xlabel('Radial Coordinate') | |
29 | -pylab.ylabel('Vz') | |
30 | -pylab.title('Radial Grid') | |
31 | -pylab.grid(True) | |
32 | -pylab.savefig("test-plot") | |
33 | -pylab.hold(False) | |
34 | -#now I create a grid for the cross-section plotting | |
35 | 23 | |
36 | 24 | theta=linspace(0.,2.*pi,nt) |
37 | 25 | #print "theta is ", theta |
@@ -47,13 +35,20 @@ | ||
47 | 35 | |
48 | 36 | |
49 | 37 | #pylab.colorbar() |
50 | -pylab.clf() | |
51 | -pylab.contourf(rsin_t.transpose(), rcos_t.transpose(), vel_section.transpose(),arange(0,(max(ravel(vel_section))+0.01),0.01),interpolation="bilinear",cmap=pylab.cm.jet) | |
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) | |
52 | 48 | pylab.colorbar() |
53 | 49 | |
54 | 50 | #pylab.show() |
55 | 51 | |
56 | -pylab.savefig("velocity_on_section.png") | |
57 | -pylab.hold(False) | |
52 | +pylab.savefig("velocity_on_section_DNS.png") | |
53 | +#pylab.hold(False) | |
58 | 54 | |
59 | -print 'So far so good' | |
\ No newline at end of file |