1 | """Script for running tsunami inundation scenario for Dampier, WA, Australia. |
---|
2 | |
---|
3 | Source data such as elevation and boundary data is assumed to be available in |
---|
4 | directories specified by project.py |
---|
5 | The output sww file is stored in project.output_run_time_dir |
---|
6 | |
---|
7 | The scenario is defined by a triangular mesh created from project.polygon, |
---|
8 | the elevation data and a simulated tsunami generated with URS code. |
---|
9 | |
---|
10 | Ole Nielsen and Duncan Gray, GA - 2005 and Jane Sexton, Nick Bartzis, GA - 2006 |
---|
11 | """ |
---|
12 | |
---|
13 | #------------------------------------------------------------------------------ |
---|
14 | # Import necessary modules |
---|
15 | #------------------------------------------------------------------------------ |
---|
16 | |
---|
17 | # Standard modules |
---|
18 | |
---|
19 | # # Related major packages |
---|
20 | # from anuga.shallow_water import Domain |
---|
21 | from anuga.shallow_water.data_manager import URS_points_needed_to_file, \ |
---|
22 | urs_ungridded2sww |
---|
23 | #import project # Definition of file names and polygons |
---|
24 | |
---|
25 | #----------------------------------------------------------------------------- |
---|
26 | # With no project file |
---|
27 | #----------------------------------------------------------------------------- |
---|
28 | from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon |
---|
29 | from os import sep, environ, getenv, getcwd ,umask |
---|
30 | from anuga.utilities.system_tools import get_user_name, get_host_name |
---|
31 | |
---|
32 | # INUNDATIONHOME is the inundation directory, not the data directory. |
---|
33 | home = getenv('INUNDATIONHOME') + sep +'data'+sep #Sandpit's parent dir |
---|
34 | user = get_user_name() |
---|
35 | host = get_host_name() |
---|
36 | |
---|
37 | #Making assumptions about the location of scenario data |
---|
38 | state = 'western_australia' |
---|
39 | scenario_name = 'carnarvon' |
---|
40 | scenario = 'carnarvon_tsunami_scenario' |
---|
41 | |
---|
42 | anuga_dir = home+state+sep+scenario+sep+'anuga'+sep |
---|
43 | polygons_dir = anuga_dir+'polygons'+sep |
---|
44 | |
---|
45 | #boundaries locations |
---|
46 | boundaries_in_dir = anuga_dir + sep + 'boundaries' + sep + scenario_name |
---|
47 | boundaries_dir = anuga_dir+'boundaries'+sep |
---|
48 | boundaries_dir_name = boundaries_dir + scenario_name |
---|
49 | |
---|
50 | # bounding polygon for study area |
---|
51 | poly_all = read_polygon(polygons_dir+'poly_all.csv') |
---|
52 | |
---|
53 | |
---|
54 | |
---|
55 | #----------------------------------------------------------------------------- |
---|
56 | # run_boundary_points |
---|
57 | #----------------------------------------------------------------------------- |
---|
58 | |
---|
59 | LL_LAT = -50.0 #ll_lat - lower left latitude, in decimal degrees |
---|
60 | LL_LONG = 80.0 #ll-long - lower left longitude, in decimal degrees |
---|
61 | GRID_SPACING = 2.0/60.0 #grid_spacing - in deciamal degrees |
---|
62 | LAT_AMOUNT = 4800 #lat_amount - number of latitudes |
---|
63 | LONG_AMOUNT = 3600 #long_amount- number of longs |
---|
64 | ZONE = 49 |
---|
65 | |
---|
66 | #------------------------------------------------------------------------------ |
---|
67 | # Copy scripts to time stamped output directory and capture screen |
---|
68 | # output to file |
---|
69 | #------------------------------------------------------------------------------ |
---|
70 | poly = poly_all |
---|
71 | print "poly", poly |
---|
72 | print "project.boundaries_in_dir",boundaries_in_dir |
---|
73 | URS_points_needed_to_file(boundaries_in_dir,poly, ZONE, |
---|
74 | LL_LAT, LL_LONG,GRID_SPACING,LAT_AMOUNT, LONG_AMOUNT,export_csv=True) |
---|
75 | #URS_points_needed_to_file(project.boundaries_dir_name5,poly, export_csv=True, zone=50) |
---|
76 | #URS_points_needed_to_file(project.boundaries_dir_name5,poly, export_csv=True) |
---|
77 | #urs_ungridded2sww(project.boundaries_in_dir_name2, project.boundaries_dir_name5, mean_stage= project.tide, verbose=True) |
---|