Changeset 3967
- Timestamp:
- Nov 13, 2006, 10:23:07 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/data_manager.py
r3964 r3967 1874 1874 y = fid.variables['y'][:] 1875 1875 volumes = fid.variables['volumes'][:] 1876 times = fid.variables['time'][:]1877 1876 if timestep is not None: 1878 1877 times = fid.variables['time'][timestep] 1878 else: 1879 times = fid.variables['time'][:] 1879 1880 1880 1881 number_of_timesteps = fid.dimensions['number_of_timesteps'] 1881 1882 number_of_points = fid.dimensions['number_of_points'] 1883 1882 1884 if origin is None: 1883 1885 … … 1921 1923 else: 1922 1924 print ' t [s] in [%f, %f], len(t) == %d'\ 1923 1925 %(min(times), max(times), len(times)) 1924 1926 print ' Quantities [SI units]:' 1925 for name in ['stage', 'xmomentum', 'ymomentum' , 'elevation']:1927 for name in ['stage', 'xmomentum', 'ymomentum']: 1926 1928 q = fid.variables[name][:].flat 1927 print ' %s in [%f, %f]' %(name, min(q), max(q)) 1928 1929 1929 if timestep is not None: 1930 q = q[timestep*len(x):(timestep+1)*len(x)] 1931 if verbose: print ' %s in [%f, %f]' %(name, min(q), max(q)) 1932 for name in ['elevation']: 1933 q = fid.variables[name][:].flat 1934 if verbose: print ' %s in [%f, %f]' %(name, min(q), max(q)) 1935 1930 1936 # Get quantity and reduce if applicable 1931 1937 if verbose: print 'Processing quantity %s' %quantity … … 1934 1940 quantity_dict = {} 1935 1941 for name in fid.variables.keys(): 1936 quantity_dict[name] = fid.variables[name][:] 1942 quantity_dict[name] = fid.variables[name][:] 1937 1943 1938 1944 … … 1945 1951 if verbose: print 'Reducing quantity %s' %quantity 1946 1952 q_reduced = zeros( number_of_points, Float ) 1947 1948 for k in range(number_of_points): 1949 q_reduced[k] = reduction( q[:,k] ) 1953 1954 if timestep is not None: 1955 for k in range(number_of_points): 1956 q_reduced[k] = q[timestep,k] 1957 else: 1958 for k in range(number_of_points): 1959 q_reduced[k] = reduction( q[:,k] ) 1950 1960 1951 1961 q = q_reduced
Note: See TracChangeset
for help on using the changeset viewer.