Changeset 7452 for anuga_core/source/anuga/visualiser
- Timestamp:
- Sep 1, 2009, 10:29:19 AM (16 years ago)
- Location:
- anuga_core/source/anuga/visualiser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/visualiser/offline.py
r4325 r7452 1 from Numeric import array, Float, ravel, zeros 1 #from Numeric import array, Float, ravel, zeros 2 import numpy as num 2 3 from Scientific.IO.NetCDF import NetCDFFile 3 4 from Tkinter import Button, E, Tk, W, Label, StringVar, Scale, HORIZONTAL … … 80 81 else: 81 82 N_vert = len(fin.variables[quantityName]) 82 x = ravel(array(fin.variables['x'], Float))83 y = ravel(array(fin.variables['y'], Float))83 x = num.ravel(num.array(fin.variables['x'], num.float)) 84 y = num.ravel(num.array(fin.variables['y'], num.float)) 84 85 if dynamic is True: 85 q = array(fin.variables[quantityName][frameNumber], Float)86 else: 87 q = ravel(array(fin.variables[quantityName], Float))86 q = num.array(fin.variables[quantityName][frameNumber], num.float) 87 else: 88 q = num.ravel(num.array(fin.variables[quantityName], num.float)) 88 89 89 90 q *= self.height_zScales[quantityName] … … 123 124 for q in filter(lambda n:n != 'x' and n != 'y' and n != 'z' and n != 'time' and n != 'volumes', fin.variables.keys()): 124 125 if len(fin.variables[q].shape) == 1: # Not a time-varying quantity 125 quantities[q] = ravel(array(fin.variables[q], Float))126 quantities[q] = num.ravel(num.array(fin.variables[q], num.float)) 126 127 else: # Time-varying, get the current timestep data 127 quantities[q] = array(fin.variables[q][self.frameNumber], Float)128 quantities[q] = num.array(fin.variables[q][self.frameNumber], num.float) 128 129 fin.close() 129 130 return quantities -
anuga_core/source/anuga/visualiser/realtime.py
r6113 r7452 1 from Numeric import Float, zeros, shape 1 #from import Float, zeros, shape 2 import numpy as num 2 3 from Tkinter import Button, E, Tk, W 3 4 from threading import Event … … 47 48 48 49 # Also build vert_index - a list of the x & y values of each vertex 49 self.vert_index = zeros((N_vert,2), Float)50 self.vert_index = num.zeros((N_vert,2), num.float) 50 51 for n in range(N_tri): 51 52 self.vtk_cells.InsertNextCell(3) … … 56 57 def update_height_quantity(self, quantityName, dynamic=True): 57 58 N_vert = len(self.source.get_vertex_coordinates()) 58 qty_index = zeros(N_vert, Float)59 qty_index = num.zeros(N_vert, num.float) 59 60 triangles = self.source.get_triangles() 60 61 vertex_values, _ = self.source.get_quantity(quantityName).get_vertex_values(xy=False, smooth=False)
Note: See TracChangeset
for help on using the changeset viewer.