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 |
---|
8 | import sys, string, os, arcgisscripting |
---|
9 | |
---|
10 | # Create the Geoprocessor object |
---|
11 | gp = arcgisscripting.create() |
---|
12 | |
---|
13 | # Check out any necessary licenses |
---|
14 | gp.CheckOutExtension("spatial") |
---|
15 | |
---|
16 | # Load required toolboxes... |
---|
17 | gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Spatial Analyst Tools.tbx") |
---|
18 | gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx") |
---|
19 | |
---|
20 | output_loc = "\\\\nas2\\gemd\\georisk_models\\inundation\\data\\western_australia\\FESA_outputs_Dec_08\\ARCgrids\\April_2009\\" |
---|
21 | input_scenario = "\\\\nas2\\gemd\\georisk_models\\inundation\\data\\western_australia\\carnarvon_tsunami_scenario\\" |
---|
22 | input_output = input_scenario + "\\anuga\\outputs\\" |
---|
23 | community = 'Carnarvon' |
---|
24 | location = 'CBD' |
---|
25 | in_Tsunami_1_HAT = input_output + "20090324_154738_run_final_1_27283_Bt_kvanputt\\raster.gdb\\" |
---|
26 | in_Tsunami_1_MSL = input_output + "20090327_160753_run_final_0_27283_Bt_kvanputt\\raster.gdb\\" |
---|
27 | in_Tsunami_2_HAT = input_output + "20090324_134442_run_final_1_27255_Bt_kvanputt\\raster.gdb\\" |
---|
28 | in_Tsunami_2_MSL = input_output + "20090327_154824_run_final_0_27255_Bt_kvanputt\\raster.gdb\\" |
---|
29 | in_Tsunami_3_HAT = input_output + "20090324_154824_run_final_1_68693_Bt_kvanputt\\raster.gdb\\" |
---|
30 | in_Tsunami_3_MSL = input_output + "20090327_154730_run_final_0_68693_Bt_kvanputt\\raster.gdb\\" |
---|
31 | |
---|
32 | Tsunami_1_HAT = output_loc + "Tsunami1-Exmouth\\" + community + "_HAT.gdb\\" |
---|
33 | Tsunami_1_MSL = output_loc + "Tsunami1-Exmouth\\" + community + "_MSL.gdb\\" |
---|
34 | Tsunami_2_HAT = output_loc + "Tsunami2-Perth\\" + community + "_HAT.gdb\\" |
---|
35 | Tsunami_2_MSL = output_loc + "Tsunami2-Perth\\" + community + "_MSL.gdb\\" |
---|
36 | Tsunami_3_HAT = output_loc + "Tsunami3-1833\\" + community + "_HAT.gdb\\" |
---|
37 | Tsunami_3_MSL = output_loc + "Tsunami3-1833\\" + community + "_MSL.gdb\\" |
---|
38 | |
---|
39 | depth = 'CBD_dep__M_E' |
---|
40 | speed = 'CBD_speed_' |
---|
41 | hr = community + '_runup' |
---|
42 | |
---|
43 | # Local variables... |
---|
44 | # polygon clip |
---|
45 | if location == 'CBD': |
---|
46 | extent = input_scenario + "map_work\\Carnarvon.gdb\\Polygon\\Carnarvon5m" |
---|
47 | |
---|
48 | # Output locations |
---|
49 | |
---|
50 | |
---|
51 | |
---|
52 | hr_1_HAT = Tsunami_1_HAT +"highest_runup" |
---|
53 | hr_1_MSL = Tsunami_1_MSL +"highest_runup" |
---|
54 | hr_2_HAT = Tsunami_2_HAT +"highest_runup" |
---|
55 | hr_2_MSL = Tsunami_2_MSL +"highest_runup" |
---|
56 | hr_3_HAT = Tsunami_3_HAT +"highest_runup" |
---|
57 | hr_3_MSL = Tsunami_3_MSL +"highest_runup" |
---|
58 | |
---|
59 | depth_1_HAT = Tsunami_1_HAT + location + "_depth" |
---|
60 | depth_1_MSL = Tsunami_1_MSL + location + "_depth" |
---|
61 | depth_2_HAT = Tsunami_2_HAT + location + "_depth" |
---|
62 | depth_2_MSL = Tsunami_2_MSL + location + "_depth" |
---|
63 | depth_3_HAT = Tsunami_3_HAT + location + "_depth" |
---|
64 | depth_3_MSL = Tsunami_3_MSL + location + "_depth" |
---|
65 | |
---|
66 | speed_1_HAT = Tsunami_1_HAT + location + "_speed" |
---|
67 | speed_1_MSL = Tsunami_1_MSL + location + "_speed" |
---|
68 | speed_2_HAT = Tsunami_2_HAT + location + "_speed" |
---|
69 | speed_2_MSL = Tsunami_2_MSL + location + "_speed" |
---|
70 | speed_3_HAT = Tsunami_3_HAT + location + "_speed" |
---|
71 | speed_3_MSL = Tsunami_3_MSL + location + "_speed" |
---|
72 | |
---|
73 | |
---|
74 | # Input locations |
---|
75 | |
---|
76 | in_depth_1_HAT = in_Tsunami_1_HAT + depth |
---|
77 | in_depth_1_MSL = in_Tsunami_1_MSL + depth |
---|
78 | in_depth_2_HAT = in_Tsunami_2_HAT + depth |
---|
79 | in_depth_2_MSL = in_Tsunami_2_MSL + depth |
---|
80 | in_depth_3_HAT = in_Tsunami_3_HAT + depth |
---|
81 | in_depth_3_MSL = in_Tsunami_3_MSL + depth |
---|
82 | |
---|
83 | in_speed_1_HAT = in_Tsunami_1_HAT + speed |
---|
84 | in_speed_1_MSL = in_Tsunami_1_MSL + speed |
---|
85 | in_speed_2_HAT = in_Tsunami_2_HAT + speed |
---|
86 | in_speed_2_MSL = in_Tsunami_2_MSL + speed |
---|
87 | in_speed_3_HAT = in_Tsunami_3_HAT + speed |
---|
88 | in_speed_3_MSL = in_Tsunami_3_MSL + speed |
---|
89 | |
---|
90 | in_hr_1_HAT = in_Tsunami_1_HAT + hr |
---|
91 | in_hr_1_MSL = in_Tsunami_1_MSL + hr |
---|
92 | in_hr_2_HAT = in_Tsunami_2_HAT + hr |
---|
93 | in_hr_2_MSL = in_Tsunami_2_MSL + hr |
---|
94 | in_hr_3_HAT = in_Tsunami_3_HAT + hr |
---|
95 | in_hr_3_MSL = in_Tsunami_3_MSL + hr |
---|
96 | |
---|
97 | |
---|
98 | # Process: Extract by Mask |
---|
99 | |
---|
100 | print 'Extract by mask for depth' |
---|
101 | gp.ExtractByMask_sa(in_depth_1_HAT, extent, depth_1_HAT) |
---|
102 | gp.ExtractByMask_sa(in_depth_1_MSL, extent, depth_1_MSL) |
---|
103 | gp.ExtractByMask_sa(in_depth_2_HAT, extent, depth_2_HAT) |
---|
104 | gp.ExtractByMask_sa(in_depth_2_MSL, extent, depth_2_MSL) |
---|
105 | gp.ExtractByMask_sa(in_depth_3_HAT, extent, depth_3_HAT) |
---|
106 | gp.ExtractByMask_sa(in_depth_3_MSL, extent, depth_3_MSL) |
---|
107 | |
---|
108 | print 'Extract by mask for speed' |
---|
109 | gp.ExtractByMask_sa(in_speed_1_HAT, extent, speed_1_HAT) |
---|
110 | gp.ExtractByMask_sa(in_speed_1_MSL, extent, speed_1_MSL) |
---|
111 | gp.ExtractByMask_sa(in_speed_2_HAT, extent, speed_2_HAT) |
---|
112 | gp.ExtractByMask_sa(in_speed_2_MSL, extent, speed_2_MSL) |
---|
113 | gp.ExtractByMask_sa(in_speed_3_HAT, extent, speed_3_HAT) |
---|
114 | gp.ExtractByMask_sa(in_speed_3_MSL, extent, speed_3_MSL) |
---|
115 | |
---|
116 | |
---|
117 | # Process: Copy Features... |
---|
118 | |
---|
119 | print 'Copy Highest Runup' |
---|
120 | gp.CopyFeatures_management(in_hr_1_HAT, hr_1_HAT, "", "0", "0", "0") |
---|
121 | gp.CopyFeatures_management(in_hr_1_MSL, hr_1_MSL, "", "0", "0", "0") |
---|
122 | gp.CopyFeatures_management(in_hr_2_HAT, hr_2_HAT, "", "0", "0", "0") |
---|
123 | gp.CopyFeatures_management(in_hr_2_MSL, hr_2_MSL, "", "0", "0", "0") |
---|
124 | gp.CopyFeatures_management(in_hr_3_HAT, hr_3_HAT, "", "0", "0", "0") |
---|
125 | gp.CopyFeatures_management(in_hr_3_MSL, hr_3_MSL, "", "0", "0", "0") |
---|
126 | |
---|