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