1 | """This script allows the user to view the stage values of the scenario output |
---|
2 | sww file (for the sydney tsunami scenario 2006) at the gauge points defined. |
---|
3 | |
---|
4 | The gauge points are defined in the same directory which runs the scenario |
---|
5 | script and the output is written to that directory as well. |
---|
6 | |
---|
7 | The output file can then be read into Excel as a comma delimited file |
---|
8 | (deselect the tab delimiter). |
---|
9 | |
---|
10 | The user should follow these steps to view the output: |
---|
11 | |
---|
12 | * copy and transpose the given data and paste |
---|
13 | * select the first two points in the first column, insert cells and shift |
---|
14 | cells down |
---|
15 | * delete first two rows |
---|
16 | * order the data by the first column (describes time) |
---|
17 | * plot (subsequent columns describe stage height at gauge points defined) |
---|
18 | |
---|
19 | NOTE - the directory structure is set according to that on Jane's machine. |
---|
20 | Please update the outputhome and productionhome paths according to your setup. |
---|
21 | |
---|
22 | Duncan Gray, Jane Sexton and Adrian Hitchman, GA 2006 """ |
---|
23 | |
---|
24 | from interpolate_sww import interpolate_sww2xya |
---|
25 | from os import sep |
---|
26 | |
---|
27 | print '\n\ |
---|
28 | The directory structure is set up according to that on Jane\'s machine. \n\ |
---|
29 | \n\ |
---|
30 | Please update the outputhome and productionhome paths according \n\ |
---|
31 | to your computer. ' |
---|
32 | |
---|
33 | #outputhome = '..\..\..\..\sydney_tsunami_scenario_2006\output' |
---|
34 | outputhome = '..\..\..\..\sydney_tsunami_scenario_2006\output' |
---|
35 | productionhome = '..\..\production\sydney_2006' |
---|
36 | |
---|
37 | #swwfilename = outputhome + sep + 'sydney_2006_100.sww' |
---|
38 | #swwfilename = outputhome + sep + 'bathyland100.sww' |
---|
39 | swwfilename = outputhome + sep + 'slump.sww' |
---|
40 | gaugepointsfilename = productionhome + sep + 'harbour_gauge.xya' |
---|
41 | #gaugepointsfilename = productionhome + sep + 'bay_gauge.xya' |
---|
42 | outputfilename1 = productionhome + sep + 'interpolate_output1.xya' |
---|
43 | outputfilename2 = productionhome + sep + 'interpolate_output2.xya' |
---|
44 | |
---|
45 | interpolate_sww2xya(swwfilename, 'stage', gaugepointsfilename, \ |
---|
46 | outputfilename1, display_errors = True) |
---|
47 | #interpolate_sww2xya(swwfilename, 'depth', gaugepointsfilename, \ |
---|
48 | # outputfilename2, display_errors = True) |
---|