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

Contents of /trunk/dudley/test/python/axisymm-movie.py

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.26