Changeset 3851 for anuga_work/production/dampier_2006/build_dampier.py
- Timestamp:
- Oct 25, 2006, 3:19:29 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/dampier_2006/build_dampier.py
r3841 r3851 30 30 from anuga.shallow_water import Reflective_boundary 31 31 from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts 32 33 32 from anuga.pmesh.mesh_interface import create_mesh_from_regions 34 35 33 from anuga.geospatial_data.geospatial_data import * 36 34 … … 38 36 import project # Definition of file names and polygons 39 37 40 41 42 38 #------------------------------------------------------------------------------ 43 39 # Copy scripts to time stamped output directory and capture screen 44 40 # output to file 45 41 #------------------------------------------------------------------------------ 42 #print 'project.build_time', project.build_time 43 #print 'project.output_build_time_dir',project.output_build_time_dir 44 #print '__file__, project.output_time_dir + basename(__file__)', __file__, project.output_build_time_dir + basename(__file__) 45 #print 'dirname(project.__file__) +sep+ project.__name__', dirname(project.__file__) +sep+ project.__name__+'.py' 46 #print'project.topographies_time_dir',project.topographies_time_dir, project.combined_time_dir_name + '.pts' 47 #print project.boundaries_time_dir, project.boundaries_time_dir_name 48 #import sys; sys.exit() 49 if access(project.output_build_time_dir,F_OK) == 0: 50 mkdir (project.output_build_time_dir) 51 copy (dirname(project.__file__) +sep+ project.__name__+'.py', 52 project.output_build_time_dir + project.__name__+'.py') #copies project.py 53 copy (__file__, project.output_build_time_dir + basename(__file__)) 54 print 'files '+ project.__name__+'.py and '+ basename(__file__)+' copied to '+ project.output_build_time_dir #copies this file 55 #import sys; sys.exit() 46 56 47 48 49 # creates copy of code in output dir if dir doesn't exist50 if access(project.output_time_dir,F_OK) == 0:51 mkdir (project.output_time_dir)52 copy (dirname(project.__file__) +sep+ project.__name__+'.py',53 project.output_time_dir + project.__name__+'.py') #copies project.py54 copy (__file__, project.output_time_dir + basename(__file__))55 print 'project.output_time_dir',project.output_time_dir #copies this file56 57 58 59 60 boundary_dir_name = project.boundary_dir_name61 62 63 from anuga.shallow_water.data_manager import urs2sww64 65 print 'minlat=project.north_boundary, maxlat=project.south_boundary',project.north_boundary, project.south_boundary66 print 'minlon= project.west_boundary, maxlon=project.east_boundary',project.west_boundary, project.east_boundary67 68 #import sys; sys.exit()69 urs2sww(boundary_dir_name,70 # minlat=project.south, maxlat=project.north,71 # minlon= project.west, maxlon=project.east,72 # mint=0, maxt= 35000,73 verbose='true')74 75 import sys; sys.exit()76 57 #------------------------------------------------------------------------------- 77 58 # Preparation of topographic data … … 102 83 offshore_dir_name14 = project.offshore_dir_name14 103 84 104 105 106 # files to be used107 #file_used = []108 109 85 # creates DEM from asc data 110 86 convert_dem_from_ascii2netcdf(onshore_dir_name, use_cache=True, verbose=True) … … 120 96 verbose=True) 121 97 122 123 98 #creates pts file for islands DEM 124 99 dem2pts(islands_dir_name, use_cache=True, verbose=True) 125 100 126 127 print'create G1' 101 print'create Geospatial data objects from topographies' 128 102 G1 = Geospatial_data(file_name = project.onshore_dir_name + '.pts') 129 103 G2 = Geospatial_data(file_name = project.coast_dir_name + '.xya') … … 145 119 G_off14 = Geospatial_data(file_name = project.offshore_dir_name14 + '.xya') 146 120 147 print'add G1+G2+G3+all offshore data'121 print'add all geospatial objects' 148 122 G = G1 + G2 + G3 + G_off + G_off1 + G_off2 + G_off3 + G_off4 + G_off5 \ 149 123 + G_off6 + G_off7 + G_off8 + G_off9 + G_off10 + G_off11 + G_off12 \ 150 124 + G_off13 + G_off14 151 125 126 print'clip combined geospatial object by bounding polygon' 152 127 G.clip(project.bounding_polygon) 153 128 #FIXME: add a clip function to pts 154 129 155 print'export G' 156 G.export_points_file(project.combined_dir_name + '.pts') 157 import sys; sys.exit() 158 159 130 print'export combined DEM file' 131 if access(project.topographies_time_dir,F_OK) == 0: 132 mkdir (project.topographies_time_dir) 133 G.export_points_file(project.combined_time_dir_name + '.pts') 160 134 161 135 #------------------------------------------------------------------------- 162 136 # Convert URS to SWW file for boundary conditions 163 137 #------------------------------------------------------------------------- 164 165 # filenames 166 meshname = project.mesh_name+'.msh' 167 source_dir = project.boundarydir 168 boundary_file = project.boundaryname 169 170 print 'Available boundary tags', domain.get_boundary_tags() 138 print 'starting to create boundary conditions' 139 boundaries_dir_name = project.boundaries_dir_name 171 140 172 141 from anuga.shallow_water.data_manager import urs2sww 173 142 174 urs2sww(boundary_file, 175 minlat=project.north_boundary, maxlat=project.south_boundary, 143 print 'minlat=project.north_boundary, maxlat=project.south_boundary',project.north_boundary, project.south_boundary 144 print 'minlon= project.west_boundary, maxlon=project.east_boundary',project.west_boundary, project.east_boundary 145 146 if access(project.boundaries_time_dir,F_OK) == 0: 147 mkdir (project.boundaries_time_dir) 148 urs2sww(boundaries_dir_name,basename_out= project.boundaries_time_dir_name, 149 minlat=project.south_boundary, maxlat=project.north_boundary, 176 150 minlon= project.west_boundary, maxlon=project.east_boundary, 151 mint=0, maxt= 35000, 177 152 verbose='true') 153 178 154 179 155 … … 182 158 183 159 160 161
Note: See TracChangeset
for help on using the changeset viewer.