/[escript]/trunk/pyvisi/py_src/examples/seriesofreadsoffline.py
ViewVC logotype

Contents of /trunk/pyvisi/py_src/examples/seriesofreadsoffline.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 994 - (show annotations)
Fri Feb 23 07:00:54 2007 UTC (12 years, 2 months ago) by jongui
File MIME type: text/x-python
File size: 1226 byte(s)
Modified the way setActiveScalar, setActiveVector and setActiveTensor are specified. It appears that the attributes have to be set each time a new file is read.
1 from esys.pyvisi import Scene, DataCollector, MapOnScalarClip, Camera, Map, Contour
2 from esys.pyvisi.constant import *
3 import time
4
5 s = Scene(renderer = Renderer.OFFLINE_JPG, num_viewport = 4, x_size = 1152,
6 y_size = 864)
7
8 dc1 = DataCollector(source = Source.XML)
9 dc1.setFileName(file_name =
10 "/home/jongui/data/laurent/talus/source/phi_talus_lava.0200.vtu")
11 dc1.setActiveScalar("lava")
12
13 dc2 = DataCollector(source = Source.XML)
14 dc2.setFileName(file_name =
15 "/home/jongui/data/laurent/talus/source/phi_talus_lava.0200.vtu")
16
17 mosc1_1 = Contour(scene = s, data_collector = dc1, lut = Lut.COLOR,
18 viewport = Viewport.SOUTH_WEST)
19 mosc1_1.generateContours(0)
20
21 mosc1_2 = Contour(scene = s, data_collector = dc2, lut = Lut.COLOR,
22 viewport = Viewport.SOUTH_WEST)
23 mosc1_2.generateContours(0)
24
25
26 # Generate multiple images from multiple files.
27 for i in range(90, 600):
28 print "Generating image", i
29 dc1.setFileName(file_name =
30 "/home/jongui/data/laurent/talus/source/phi_talus_lava.%04d.vtu" % i)
31 dc1.setActiveScalar("lava")
32 dc2.setFileName(file_name =
33 "/home/jongui/data/laurent/talus/source/phi_talus_lava.%04d.vtu" % i)
34
35 s.saveImage("output/%04d.jpg" % i)

  ViewVC Help
Powered by ViewVC 1.1.26