Changeset 1919 for inundation/pyvolution/data_manager.py
- Timestamp:
- Oct 14, 2005, 11:26:21 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/pyvolution/data_manager.py
r1911 r1919 1248 1248 1249 1249 1250 if quantity is given, out values from quantity otherwise default to 1251 elevation 1250 The parameter quantity must be the name of an existing quantity or 1251 an expression involving existing quantities. The default is 1252 'elevation'. 1252 1253 1253 1254 if timestep (an index) is given, output quantity at that timestep … … 1262 1263 from Numeric import array, Float, concatenate, NewAxis, zeros, reshape, sometrue 1263 1264 from utilities.polygon import inside_polygon 1265 from util import apply_expression_to_dictionary 1264 1266 1265 1267 msg = 'Format must be either asc or ers' … … 1315 1317 1316 1318 #Get quantity and reduce if applicable 1317 if verbose: print 'Reading quantity %s' %quantity 1318 1319 if quantity.lower() == 'depth': 1320 q = fid.variables['stage'][:] - fid.variables['elevation'][:] 1321 else: 1322 q = fid.variables[quantity][:] 1319 if verbose: print 'Processing quantity %s' %quantity 1320 1321 #Turn NetCDF objects into Numeric arrays 1322 quantity_dict = {} 1323 for name in fid.variables.keys(): 1324 1325 if name not in ['x', 'y', 'volumes', 'time']: 1326 quantity_dict[name] = fid.variables[name][:] 1327 1328 #print quantity_dict 1329 1330 1331 q = apply_expression_to_dictionary(quantity, quantity_dict) 1323 1332 1324 1333
Note: See TracChangeset
for help on using the changeset viewer.