source: anuga_work/production/wa/busselton_2009/Busselton4distribution.py @ 7436

Last change on this file since 7436 was 7119, checked in by kristy, 15 years ago
File size: 5.8 KB
Line 
1# ---------------------------------------------------------------------------
2# Carnarvon4distribution.py
3# Created on: Thu Apr 30 2009 03:51:03 PM
4#   (generated by ArcGIS/ModelBuilder)
5# ---------------------------------------------------------------------------
6
7# Import system modules
8import sys, string, os, arcgisscripting
9
10# Create the Geoprocessor object
11gp = arcgisscripting.create()
12
13# Check out any necessary licenses
14gp.CheckOutExtension("spatial")
15
16# Load required toolboxes...
17gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Spatial Analyst Tools.tbx")
18gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx")
19gp.overwriteoutput = 1
20
21community = 'Busselton'
22output_loc = "\\\\nas2\\gemd\\georisk_models\\inundation\\data\\western_australia\\FESA_outputs_Dec_08\\ARCgrids\\April_2009\\"
23input_scenario = "\\\\nas2\\gemd\\georisk_models\\inundation\\data\\western_australia\\busselton_tsunami_scenario\\"
24input_output = input_scenario + "\\anuga\\outputs\\"
25
26locations = ['Bunbury', 'Busselton']
27
28in_Tsunami_1_HAT = input_output + "20090327_152717_run_final_0.6_27283_Bt_kvanputt\\raster.gdb\\"
29in_Tsunami_1_MSL = input_output + "20090330_120458_run_final_0_27283_Bt_kvanputt\\raster.gdb\\"
30in_Tsunami_2_HAT = input_output + "20090324_134328_run_final_0.6_27255_Bt_kvanputt\\raster.gdb\\"
31in_Tsunami_2_MSL = input_output + "20090327_160646_run_final_0_27255_Bt_kvanputt\\raster.gdb\\"
32in_Tsunami_3_HAT = input_output + "20090324_140747_run_final_0.6_68693_Bt_kvanputt\\raster.gdb\\"
33in_Tsunami_3_MSL = input_output + "20090327_161520_run_final_0_68693_Bt_kvanputt\\raster.gdb\\"
34
35Tsunami_1_HAT = output_loc + "Tsunami1-Exmouth\\" + community + "_HAT.gdb\\"
36Tsunami_1_MSL = output_loc + "Tsunami1-Exmouth\\" + community + "_MSL.gdb\\"
37Tsunami_2_HAT = output_loc + "Tsunami2-Perth\\" + community + "_HAT.gdb\\"
38Tsunami_2_MSL = output_loc + "Tsunami2-Perth\\" + community + "_MSL.gdb\\"
39Tsunami_3_HAT = output_loc + "Tsunami3-1833\\" + community + "_HAT.gdb\\"
40Tsunami_3_MSL = output_loc + "Tsunami3-1833\\" + community + "_MSL.gdb\\"
41
42hr = community + '_runup'
43
44for location in locations:
45
46    # Local variables...
47    if location == 'Bunbury':
48        # polygon clip
49        extent = input_scenario + "map_work\\Busselton.gdb\\internal_polygons\\bunbury_1km"
50        # name of rasters
51        depth = 'Bun_depth_M_E'
52        speed = 'Bun_speed_M'
53    elif location == 'Busselton':
54        # polygon clip
55        extent = input_scenario + "map_work\\Busselton.gdb\\Internal_polygons\\busselton_1km"
56        # name of rasters
57        depth = 'Bus_depth_M_E'
58        speed = 'Bus_speed_M'
59    else:
60        print 'No recognisable location entered'
61
62    print 'location', location
63    print 'extent', extent
64
65    # Output locations
66   
67    hr_1_HAT = Tsunami_1_HAT +"highest_runup"
68    hr_1_MSL = Tsunami_1_MSL +"highest_runup"
69    hr_2_HAT = Tsunami_2_HAT +"highest_runup"
70    hr_2_MSL = Tsunami_2_MSL +"highest_runup"
71    hr_3_HAT = Tsunami_3_HAT +"highest_runup"
72    hr_3_MSL = Tsunami_3_MSL +"highest_runup"
73
74    depth_1_HAT = Tsunami_1_HAT + location + "_depth"
75    depth_1_MSL = Tsunami_1_MSL + location + "_depth"
76    depth_2_HAT = Tsunami_2_HAT + location + "_depth"
77    depth_2_MSL = Tsunami_2_MSL + location + "_depth"
78    depth_3_HAT = Tsunami_3_HAT + location + "_depth"
79    depth_3_MSL = Tsunami_3_MSL + location + "_depth"
80
81    speed_1_HAT = Tsunami_1_HAT + location + "_speed"
82    speed_1_MSL = Tsunami_1_MSL + location + "_speed"
83    speed_2_HAT = Tsunami_2_HAT + location + "_speed"
84    speed_2_MSL = Tsunami_2_MSL + location + "_speed"
85    speed_3_HAT = Tsunami_3_HAT + location + "_speed"
86    speed_3_MSL = Tsunami_3_MSL + location + "_speed"
87
88
89    # Input locations
90
91    in_depth_1_HAT = in_Tsunami_1_HAT + depth
92    in_depth_1_MSL = in_Tsunami_1_MSL + depth
93    in_depth_2_HAT = in_Tsunami_2_HAT + depth
94    in_depth_2_MSL = in_Tsunami_2_MSL + depth
95    in_depth_3_HAT = in_Tsunami_3_HAT + depth
96    in_depth_3_MSL = in_Tsunami_3_MSL + depth
97
98    in_speed_1_HAT = in_Tsunami_1_HAT + speed
99    in_speed_1_MSL = in_Tsunami_1_MSL + speed
100    in_speed_2_HAT = in_Tsunami_2_HAT + speed
101    in_speed_2_MSL = in_Tsunami_2_MSL + speed
102    in_speed_3_HAT = in_Tsunami_3_HAT + speed
103    in_speed_3_MSL = in_Tsunami_3_MSL + speed
104
105    in_hr_1_HAT = in_Tsunami_1_HAT + hr
106    in_hr_1_MSL = in_Tsunami_1_MSL + hr
107    in_hr_2_HAT = in_Tsunami_2_HAT + hr
108    in_hr_2_MSL = in_Tsunami_2_MSL + hr
109    in_hr_3_HAT = in_Tsunami_3_HAT + hr
110    in_hr_3_MSL = in_Tsunami_3_MSL + hr
111
112
113# Process: Extract by Mask
114    print 'Extract by mask for depth'
115    gp.ExtractByMask_sa(in_depth_1_HAT, extent, depth_1_HAT)
116    gp.ExtractByMask_sa(in_depth_1_MSL, extent, depth_1_MSL)
117    gp.ExtractByMask_sa(in_depth_2_HAT, extent, depth_2_HAT)
118    gp.ExtractByMask_sa(in_depth_2_MSL, extent, depth_2_MSL)
119    gp.ExtractByMask_sa(in_depth_3_HAT, extent, depth_3_HAT)
120    gp.ExtractByMask_sa(in_depth_3_MSL, extent, depth_3_MSL)
121
122    print 'Extract by mask for speed'
123    gp.ExtractByMask_sa(in_speed_1_HAT, extent, speed_1_HAT)
124    gp.ExtractByMask_sa(in_speed_1_MSL, extent, speed_1_MSL)
125    gp.ExtractByMask_sa(in_speed_2_HAT, extent, speed_2_HAT)
126    gp.ExtractByMask_sa(in_speed_2_MSL, extent, speed_2_MSL)
127    gp.ExtractByMask_sa(in_speed_3_HAT, extent, speed_3_HAT)
128    gp.ExtractByMask_sa(in_speed_3_MSL, extent, speed_3_MSL)
129
130
131# Process: Copy Features...
132
133print 'Copy Highest Runup'
134gp.CopyFeatures_management(in_hr_1_HAT, hr_1_HAT, "", "0", "0", "0")
135gp.CopyFeatures_management(in_hr_1_MSL, hr_1_MSL, "", "0", "0", "0")
136gp.CopyFeatures_management(in_hr_2_HAT, hr_2_HAT, "", "0", "0", "0")
137gp.CopyFeatures_management(in_hr_2_MSL, hr_2_MSL, "", "0", "0", "0")
138gp.CopyFeatures_management(in_hr_3_HAT, hr_3_HAT, "", "0", "0", "0")
139gp.CopyFeatures_management(in_hr_3_MSL, hr_3_MSL, "", "0", "0", "0")
140
Note: See TracBrowser for help on using the repository browser.