/[escript]/trunk/finley/test/python/axisymm-movie.py
ViewVC logotype

Annotation of /trunk/finley/test/python/axisymm-movie.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2548 - (hide annotations)
Mon Jul 20 06:20:06 2009 UTC (10 years, 3 months ago) by jfenwick
File MIME type: text/x-python
File size: 2065 byte(s)
Updating copyright notices
1 ksteube 1811
2     ########################################################
3     #
4 jfenwick 2548 # Copyright (c) 2003-2009 by University of Queensland
5 ksteube 1811 # Earth Systems Science Computational Center (ESSCC)
6     # http://www.uq.edu.au/esscc
7     #
8     # Primary Business: Queensland, Australia
9     # Licensed under the Open Software License version 3.0
10     # http://www.opensource.org/licenses/osl-3.0.php
11     #
12     ########################################################
13    
14     __copyright__="""Copyright (c) 2003-2008 by University of Queensland
15     Earth Systems Science Computational Center (ESSCC)
16     http://www.uq.edu.au/esscc
17     Primary Business: Queensland, Australia"""
18     __license__="""Licensed under the Open Software License version 3.0
19     http://www.opensource.org/licenses/osl-3.0.php"""
20 jfenwick 2344 __url__="https://launchpad.net/escript-finley"
21 ksteube 1811
22 gross 1393 from esys.pyvisi import Scene, DataCollector, Map, Camera, Velocity, Legend
23     from esys.pyvisi import Movie, LocalPosition
24     from esys.pyvisi.constant import *
25     import os
26    
27     X_SIZE = 800
28     Y_SIZE = 600
29    
30    
31     JPG_RENDERER = Renderer.ONLINE_JPG
32     s = Scene(renderer = JPG_RENDERER, num_viewport = 1, x_size = X_SIZE, y_size = Y_SIZE)
33    
34     # Create a DataCollector reading from a XML file.
35     dc1 = DataCollector(source = Source.XML)
36     dc1.setActiveScalar(scalar = "p")
37     dc1.setActiveVector(vector = "U")
38    
39     # Create a Map.
40     m1 = Map(scene = s, data_collector = dc1, lut = Lut.COLOR, cell_to_point = False, outline = True)
41    
42     vopc1 = Velocity(scene = s, data_collector = dc1,
43     color_mode = ColorMode.VECTOR,
44     arrow = Arrow.THREE_D, lut = Lut.COLOR, cell_to_point = False,
45     outline = False)
46     vopc1.setScaleFactor(scale_factor = 0.04)
47    
48    
49     # Create a Camera.
50     cam1 = Camera(scene = s, viewport = Viewport.SOUTH_WEST)
51    
52     # Create a movie.
53     mov = Movie()
54     #lst = []
55    
56     # Read in one file one after another and render the object.
57     images=[]
58     for i in range(0,50):
59     dc1.setFileName("u.%d.xml"%i)
60     image="frame.%06d.jpg"%i
61     s.render(image_name = os.path.join(".",image))
62     images.append(image)
63    
64     mov.imageList(input_directory = ".", image_list = images)
65    
66     # Generate the movie.
67     mov.makeMovie(os.path.join(".", "movie.mpg"))
68    

  ViewVC Help
Powered by ViewVC 1.1.26