Changeset 2623
- Timestamp:
- Mar 28, 2006, 5:45:43 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/pyvolution/data_manager.py
r2553 r2623 3530 3530 'cellsize':cellsize, 3531 3531 'NODATA_value':NODATA_value}, grid 3532 3533 def sww2timeseries(swwfile, 3534 gauge_filename, 3535 gauge_data_outname, 3536 quantity = None, 3537 time_min = None, 3538 time_max = None, 3539 verbose = False): 3540 3541 """Read SWW file and extract time series for prescribed quantities at 3542 gauge locations. 3543 3544 The gauge locations are defined in gauge_filename. This file should be 3545 in the form: gaugename, easting, northing, and should be stored in a 3546 .csv or .xya file. 3547 3548 Time series data at the gauges can be written to file (for example, 3549 Benfield requested raw data) with the default being no data written. 3550 3551 The parameter quantity must be the name of an existing quantity or 3552 an expression involving existing quantities. The default is 3553 'depth'. 3554 3555 The user can define a list of quantities. The possibilities are 3556 the conserved quantitues of the shallow water wave equation and other 3557 quantities which can be derived from those, i.e. 3558 ['depth', 'xmomentum', 'ymomentum', 'momentum', 'velocity', 'bearing']. 3559 3560 Momentum is the absolute momentum, sqrt(xmomentum^2 + ymomentum^2). 3561 Note, units of momentum are m^2/s and depth is m. 3562 3563 Velocity is absolute momentum divided by depth. (Confirming correct units: 3564 vel = abs mom / depth = (m^2/s)/m = m/s.) 3565 3566 Bearing returns the angle of the velocity vector from North. 3567 3568 If time_min and time_max is given, output plotted in that time range. 3569 The default is to plot the entire range of the time evident in sww file. 3570 3571 The export graphic format in 'png' and will be stored in the same 3572 directory as the input file. 3573 """ 3574 3575 if quantity is None: quantity = 'depth' 3576 3577 # extract gauge locations from gauge file 3578 3579 # extract all quantities from swwfile (f = file_function) 3580 if time_min is None: time_min = min(f.T) 3581 if time_max is None: time_max = max(f.T) 3582 3583 # loop through appropriate range of time 3584 # plot prescribed quantities and export data if requested 3585 3586 #if gauge_data_outname is None: 3587 3588 return
Note: See TracChangeset
for help on using the changeset viewer.