File: streamline_demo3.py

package info (click to toggle)
scitools 0.9.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 4,148 kB
  • ctags: 3,332
  • sloc: python: 34,714; sh: 112; makefile: 8
file content (42 lines) | stat: -rwxr-xr-x 844 bytes parent folder | download
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
37
38
39
40
41
42
#!/usr/bin/env python

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

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

wind = io.loadmat('wind_matlab_v6.mat.gz')
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]*36,seq(20,55,1),[5]*36)
sl = streamline(x,y,z,u,v,w,sx,sy,sz)
axis('tight')
view(30,30)
daspect([1,1,.125])
camproj('perspective')
camva(8)
box('on')
setp(show=True)
show()


figure()
# alternative syntax:
sl = streamline(x,y,z,u,v,w,sx,sy,sz,
                axis='tight',
                view=(30,30),
                daspect=[1,1,.125],
                camproj='perspective',
                camva=8,
                box='on')

raw_input('Press Return key to quit: ')