Changeset 3940 for anuga_work/production/dampier_2006/build_dampier.py
- Timestamp:
- Nov 8, 2006, 4:04:55 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/dampier_2006/build_dampier.py
r3905 r3940 32 32 from anuga.pmesh.mesh_interface import create_mesh_from_regions 33 33 from anuga.geospatial_data.geospatial_data import * 34 from anuga.abstract_2d_finite_volumes.util import Screen_Catcher34 from anuga.abstract_2d_finite_volumes.util import start_screen_catcher, copy_code_files 35 35 36 36 # Application specific imports … … 42 42 #------------------------------------------------------------------------------ 43 43 44 if access(project.output_build_time_dir,F_OK) == 0: 45 mkdir (project.output_build_time_dir) 46 copy (dirname(project.__file__) +sep+ project.__name__+'.py', 47 project.output_build_time_dir + project.__name__+'.py') #copies project.py 48 copy (__file__, project.output_build_time_dir + basename(__file__)) 49 print 'files '+ project.__name__+'.py and '+ basename(__file__)+' copied to '+ project.output_build_time_dir #copies this file 50 #import sys; sys.exit() 51 52 53 #normal screen output is stored in 54 screen_output_name = project.output_build_time_dir + "screen_output.txt" 55 screen_error_name = project.output_build_time_dir + "screen_error.txt" 56 57 #used to catch screen output to file 58 sys.stdout = Screen_Catcher(screen_output_name) 59 sys.stderr = Screen_Catcher(screen_error_name) 44 copy_code_files(project.output_build_time_dir,__file__, 45 dirname(project.__file__)+sep+ project.__name__+'.py' ) 46 47 start_screen_catcher(project.output_build_time_dir) 60 48 61 49 print 'USER: ', project.user … … 125 113 G_off13 = Geospatial_data(file_name = project.offshore_dir_name13 + '.xya') 126 114 G_off14 = Geospatial_data(file_name = project.offshore_dir_name14 + '.xya') 127 115 ''' 116 117 118 print'clip nw', project.clip_poly_nw 119 print'clip e', project.clip_poly_e 120 121 print'reading combined_dir_name' 122 G_offshore_data = Geospatial_data(file_name = project.topographies_dir+'dampier_combined_elevation_final.pts') 123 124 print'reading offshore_dir_name_old' 125 G_offshore_old = Geospatial_data(file_name = project.offshore_dir_name_old + '.pts') 126 127 ''' 128 print 'G_offshore_data_old_nw', 129 G_nw_name = project.topographies_dir + 'nw_old_data' 130 G_offshore_nw = G_offshore_old.clip(project.clip_poly_nw) 131 G_offshore_nw.export_points_file(G_nw_name + '.pts') 132 G_offshore_nw.export_points_file(G_nw_name + '.xya') 133 G_nw = array(G_offshore_nw.get_data_points()) 134 print'shape of arr nw data', G_nw.shape 135 print' max and min of array 0',max(G_nw[:,0]),min(G_nw[:,0]) 136 print' max and min of array 1',max(G_nw[:,1]),min(G_nw[:,1]) 137 138 print 'G_offshore_data_old_e'#, G_offshore_old_nw.get_data_points() 139 G_e_name = project.topographies_dir+'e_old_data' 140 G_offshore_e = G_offshore_old.clip(project.clip_poly_e) 141 G_offshore_e.export_points_file(G_e_name + '.pts') 142 G_offshore_e.export_points_file(G_e_name + '.xya') 143 G_e = array(G_offshore_e.get_data_points()) 144 print'shape of arr e data', G_e.shape 145 print' max and min of array 0',max(G_e[:,0]),min(G_e[:,0]) 146 print' max and min of array 1',max(G_e[:,1]),min(G_e[:,1]) 147 ''' 148 149 print 'G_offshore_data_mid_e'#, G_offshore_old_nw.get_data_points() 150 G_mid_e_name = project.topographies_dir+'mid_e_old_data' 151 G_offshore_mid_e = G_offshore_old.clip(project.clip_poly_mid_e) 152 G_offshore_mid_e.export_points_file(G_mid_e_name + '.pts') 153 G_offshore_mid_e.export_points_file(G_mid_e_name + '.xya') 154 G_mid_e = array(G_offshore_mid_e.get_data_points()) 155 print'shape of arr e data', G_mid_e.shape 156 print' max and min of array 0',max(G_mid_e[:,0]),min(G_mid_e[:,0]) 157 print' max and min of array 1',max(G_mid_e[:,1]),min(G_mid_e[:,1]) 158 159 print 'G_offshore_data_mid_w'#, G_offshore_old_nw.get_data_points() 160 G_mid_w_name = project.topographies_dir+'mid_w_old_data' 161 G_offshore_mid_w = G_offshore_old.clip(project.clip_poly_mid_w) 162 G_offshore_mid_w.export_points_file(G_mid_w_name + '.pts') 163 G_offshore_mid_w.export_points_file(G_mid_w_name + '.xya') 164 G_mid_w = array(G_offshore_mid_w.get_data_points()) 165 print'shape of arr e data', G_mid_w.shape 166 print' max and min of array 0',max(G_mid_w[:,0]),min(G_mid_w[:,0]) 167 print' max and min of array 1',max(G_mid_w[:,1]),min(G_mid_w[:,1]) 168 169 170 print 'G_offshore_data_old_e'#, G_offshore_old_e.get_data_points() 128 171 print'add all geospatial objects' 129 G = G1 + G2 + G3 + G_off + G_off1 + G_off2 + G_off3 + G_off4 + G_off5 \ 130 + G_off6 + G_off7 + G_off8 + G_off9 + G_off10 + G_off11 + G_off12 \ 131 + G_off13 + G_off14 132 133 print'clip combined geospatial object by bounding polygon' 134 G.clip(project.bounding_polygon) 172 #G = G1 + G2 + G3 + G_off + G_off1 + G_off2 + G_off3 + G_off4 + G_off5 \ 173 # + G_off6 + G_off7 + G_off8 + G_off9 + G_off10 + G_off11 + G_off12 \ 174 # + G_off13 + G_off14 175 176 G = G_offshore_data + G_offshore_mid_w + G_offshore_mid_e 177 print'shape of arr G data', G.get_data_points().shape 178 179 180 #print'clip combined geospatial object by bounding polygon' 181 G_clipped = G.clip(project.bounding_polygon) 135 182 #FIXME: add a clip function to pts 183 print'shape of clipped data', G_clipped.get_data_points().shape 136 184 137 185 print'export combined DEM file' 138 186 if access(project.topographies_time_dir,F_OK) == 0: 139 187 mkdir (project.topographies_time_dir) 140 G.export_points_file(project.combined_time_dir_name + '.pts') 188 G_clipped.export_points_file(project.combined_time_dir_final_name + '.pts') 189 G_clipped.export_points_file(project.combined_time_dir_final_name + '.xya') 141 190 ''' 142 191 #------------------------------------------------------------------------- … … 156 205 if access(project.boundaries_time_dir,F_OK) == 0: 157 206 mkdir (project.boundaries_time_dir) 158 ''' 159 urs2sww(boundaries_in_dir_name,basename_out= project.boundaries_time_dir_name, 160 minlat=project.south_boundary, maxlat=project.north_boundary, 161 minlon= project.west_boundary, maxlon=project.east_boundary, 162 mint=0, maxt= 35000, 163 verbose='true') 164 165 166 urs2sww(boundaries_in_dir_name, basename_out= project.boundaries_time_dir_name, 167 # minlat=project.south, maxlat=project.north, 168 # minlon= project.west, maxlon=project.east, 169 minlat=project.south_boundary, maxlat=project.north_boundary, 170 minlon= project.east_boundary, maxlon=project.west_boundary, 171 mint=0, maxt= 35000, 172 verbose='true') 173 ''' 207 174 208 from caching import cache 175 209 cache(urs2sww, … … 193 227 ) 194 228 # dependencies = source_dir + project.boundary_basename + '.sww') 195 196 197 198 199 200 201 202 203 229 ''' 230 231 232 233 234 235 236 237
Note: See TracChangeset
for help on using the changeset viewer.