[2713] | 1 | Requirements for module to plot time series data after simulation run. |
---|
| 2 | |
---|
| 3 | 31 March 2006 |
---|
| 4 | |
---|
| 5 | |
---|
| 6 | |
---|
| 7 | 1. The module shall read a SWW file and plot the time series for the prescribed quantities at defined gauge locations. |
---|
| 8 | |
---|
| 9 | 1.1 The prescribed quantities must be a name of an existing quantity or an expression involving existing quantities. |
---|
| 10 | 1.1.1 The default quantity will be 'depth'. |
---|
| 11 | 1.1.2 The user can define a list of quantities. The possibilities are the conserved quantitues of the shallow water wave equation and other quantities which can be derived from those, i.e. ['stage', 'depth', 'xmomentum', 'ymomentum', 'momentum', 'velocity', 'bearing']. |
---|
| 12 | 1.1.3 Absolute momentum ('momentum') will be calculated as sqrt(xmomentum^2 + ymomentum^2). |
---|
| 13 | 1.1.4 Velocity should be calculated as absolute momentum divided (pointwise) by depth. |
---|
| 14 | 1.1.5 Bearing should return the angle of the momentum vector (xmomentum, ymomentum) from the North direction. |
---|
| 15 | |
---|
| 16 | 1.2 The gauge locations should either be defined in a separate file in which case the plotting function is |
---|
| 17 | invoked with the name of the file, or they should be provided as an argument in the form of a Numeric array |
---|
| 18 | or a structure that can be converted to a Numeric array. |
---|
| 19 | 1.2.1 The gauges file should contain the gauge name and location defined in eastings and northings. |
---|
| 20 | 1.2.2 The gauge file should be a comma separated file. |
---|
| 21 | |
---|
| 22 | 1.3 The module should be contained in data_manager.py (I think it should be a new module (Ole)) |
---|
| 23 | 1.3.1 The output should be available both as data and graphics. |
---|
| 24 | 1.3.2 The default output shall be graphics. |
---|
| 25 | 1.3.3 The output should optionally be computed for a prescribed time range. |
---|
| 26 | 1.3.4 The default time range is the complete time series. |
---|
| 27 | 1.3.5 The output should be stored in the same directory as the SWW file. |
---|
| 28 | |
---|
| 29 | 1.4 A latex document should be automatically generated which contains the output graphics. |
---|
| 30 | 1.4.1 The caption of the output graphics should contain the gauge name and other simulation parameters. |
---|
| 31 | |
---|
| 32 | The outline of the module is as follows: |
---|
| 33 | |
---|
| 34 | def sww2timeseries(swwfile, |
---|
| 35 | gauge_filename, (or a structure that contains that info, e.g. based on Geospatial_data) |
---|
| 36 | gauge_data_outname, |
---|
| 37 | quantity = None, |
---|
| 38 | time_min = None, |
---|
| 39 | time_max = None, |
---|
| 40 | verbose = False): |
---|
| 41 | |
---|
| 42 | # extract gauge locations from gauge file |
---|
| 43 | |
---|
| 44 | # extract all quantities from sww file |
---|
| 45 | |
---|
| 46 | # loop through appropriate range of time |
---|
| 47 | |
---|
| 48 | # plot prescribed quantities and export data if requested |
---|
| 49 | |
---|
| 50 | |
---|
| 51 | return |
---|
| 52 | |
---|
| 53 | |
---|
| 54 | where |
---|
| 55 | |
---|
| 56 | swwfile defines the input sww file |
---|
| 57 | gauge_filename defines the gauge (name, easting, northing) |
---|
| 58 | gauge_data_outname defined the name of the output data file (if required) |
---|
| 59 | time_min defines the beginning of the time range |
---|
| 60 | time_max defines the end of the time range |
---|