Changeset 3961
- Timestamp:
- Nov 9, 2006, 5:01:09 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/data_manager.py
r3954 r3961 1874 1874 y = fid.variables['y'][:] 1875 1875 volumes = fid.variables['volumes'][:] 1876 times = fid.variables['time'][:] 1877 if timestep is not None: 1878 times = fid.variables['time'][timestep] 1876 1879 1877 1880 number_of_timesteps = fid.dimensions['number_of_timesteps'] … … 1899 1902 #Something like print swwstats(swwname) 1900 1903 if verbose: 1901 x = fid.variables['x'][:]1902 y = fid.variables['y'][:]1903 times = fid.variables['time'][:]1904 1904 print '------------------------------------------------' 1905 1905 print 'Statistics of SWW file:' … … 1908 1908 print ' Lower left corner: [%f, %f]'\ 1909 1909 %(xllcorner, yllcorner) 1910 print ' Start time: %f' %fid.starttime[0] 1910 if timestep is not None: 1911 print ' Time: %f' %(times) 1912 else: 1913 print ' Start time: %f' %fid.starttime[0] 1911 1914 print ' Extent:' 1912 1915 print ' x [m] in [%f, %f], len(x) == %d'\ … … 1914 1917 print ' y [m] in [%f, %f], len(y) == %d'\ 1915 1918 %(min(y.flat), max(y.flat), len(y.flat)) 1916 print ' t [s] in [%f, %f], len(t) == %d'\ 1917 %(min(times), max(times), len(times)) 1919 if timestep is not None: 1920 print ' t [s] = %f, len(t) == %d' %(times, 1) 1921 else: 1922 print ' t [s] in [%f, %f], len(t) == %d'\ 1923 %(min(times), max(times), len(times)) 1918 1924 print ' Quantities [SI units]:' 1919 1925 for name in ['stage', 'xmomentum', 'ymomentum', 'elevation']: … … 1922 1928 1923 1929 1924 1925 1926 1927 1930 # Get quantity and reduce if applicable 1928 1931 if verbose: print 'Processing quantity %s' %quantity … … 1934 1937 1935 1938 1936 1937 1939 # Convert quantity expression to quantities found in sww file 1938 1940 q = apply_expression_to_dictionary(quantity, quantity_dict) 1939 1940 1941 1941 1942 1942 if len(q.shape) == 2: … … 1996 1996 x = x+xllcorner-newxllcorner 1997 1997 y = y+yllcorner-newyllcorner 1998 1998 1999 1999 vertex_points = concatenate ((x[:, NewAxis] ,y[:, NewAxis]), axis = 1) 2000 2000 assert len(vertex_points.shape) == 2 2001 2002 2003 2001 2004 2002 grid_points = zeros ( (ncols*nrows, 2), Float ) … … 2023 2021 from anuga.fit_interpolate.interpolate import Interpolate 2024 2022 2025 2023 print 'hello', vertex_points.shape, volumes.shape 2026 2024 interp = Interpolate(vertex_points, volumes, verbose = verbose) 2027 2028 2029 2025 2030 2026 #Interpolate using quantity values
Note: See TracChangeset
for help on using the changeset viewer.