File: streamline_demo1.py

package info (click to toggle)
scitools 0.7-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 17,252 kB
  • ctags: 2,871
  • sloc: python: 28,744; sh: 112; makefile: 15
file content (36 lines) | stat: -rwxr-xr-x 735 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env python

# Example taken from:
# http://www.mathworks.com/access/helpdesk/help/techdoc/ref/streamline.html

from scitools.easyviz import *
from time import sleep
from scipy import io

wind = io.loadmat('wind_matlab_v6.mat')
x = wind['x']
y = wind['y']
z = wind['z']
u = wind['u']
v = wind['v']
w = wind['w']

setp(show=False)
sx,sy,sz = ndgrid([80]*4,seq(20,50,10),seq(0,15,5),sparse=False)
sl = streamline(x,y,z,u,v,w,sx,sy,sz)
sl.setp(linecolor='r')
view(3)
axis([60,140,10,60,-5,20])
setp(show=True)
show()


figure()
# alternative syntax:
sl = streamline(x,y,z,u,v,w,sx,sy,sz,
                linecolor='r',
                view=3,
                axis=[60,140,10,60,-5,20])


raw_input('Press Return key to quit: ')