Changeset 4544 for anuga_work/production/dampier_2006/build_dampier.py
- Timestamp:
- Jun 15, 2007, 4:47:03 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/dampier_2006/build_dampier.py
r4357 r4544 36 36 37 37 # Application specific imports 38 import project # Definition of file names and polygons38 import project_urs # Definition of file names and polygons 39 39 40 40 #------------------------------------------------------------------------------ … … 42 42 # output to file 43 43 #------------------------------------------------------------------------------ 44 copy_code_files(project .output_build_time_dir,__file__,45 dirname(project .__file__)+sep+ project.__name__+'.py' )44 copy_code_files(project_urs.output_build_time_dir,__file__, 45 dirname(project_urs.__file__)+sep+ project_urs.__name__+'.py' ) 46 46 47 start_screen_catcher(project .output_build_time_dir)47 start_screen_catcher(project_urs.output_build_time_dir) 48 48 print "Processor Name:",get_processor_name() 49 49 50 print 'USER: ', project .user50 print 'USER: ', project_urs.user 51 51 52 52 #------------------------------------------------------------------------------- … … 57 57 # Fine pts file to be clipped to area of interest 58 58 #------------------------------------------------------------------------------- 59 print"project .combined_dir_name",project.combined_dir_name59 print"project_urs.combined_dir_name",project_urs.combined_dir_name 60 60 61 61 # topography directory filenames 62 onshore_in_dir_name = project .onshore_in_dir_name63 coast_in_dir_name = project .coast_in_dir_name64 offshore_in_dir_name = project .offshore_in_dir_name65 offshore1_in_dir_name = project .offshore1_in_dir_name66 offshore2_in_dir_name = project .offshore2_in_dir_name62 onshore_in_dir_name = project_urs.onshore_in_dir_name 63 coast_in_dir_name = project_urs.coast_in_dir_name 64 offshore_in_dir_name = project_urs.offshore_in_dir_name 65 offshore1_in_dir_name = project_urs.offshore1_in_dir_name 66 offshore2_in_dir_name = project_urs.offshore2_in_dir_name 67 67 68 onshore_dir_name = project .onshore_dir_name69 coast_dir_name = project .coast_dir_name70 offshore_dir_name = project .offshore_dir_name71 offshore1_dir_name = project .offshore1_dir_name72 offshore2_dir_name = project .offshore2_dir_name68 onshore_dir_name = project_urs.onshore_dir_name 69 coast_dir_name = project_urs.coast_dir_name 70 offshore_dir_name = project_urs.offshore_dir_name 71 offshore1_dir_name = project_urs.offshore1_dir_name 72 offshore2_dir_name = project_urs.offshore2_dir_name 73 73 ''' 74 74 # creates DEM from asc data … … 113 113 114 114 print'clip combined geospatial object by bounding polygon' 115 G_clipped = G.clip(project .poly_all)115 G_clipped = G.clip(project_urs.poly_all) 116 116 #FIXME: add a clip function to pts 117 117 #print'shape of clipped data', G_clipped.get_data_points().shape 118 118 119 119 print'export combined DEM file' 120 if access(project .topographies_dir,F_OK) == 0:121 mkdir (project .topographies_dir)122 G_clipped.export_points_file(project .combined_dir_name + '.pts')123 #G_clipped.export_points_file(project .combined_dir_name + '.txt')120 if access(project_urs.topographies_dir,F_OK) == 0: 121 mkdir (project_urs.topographies_dir) 122 G_clipped.export_points_file(project_urs.combined_dir_name + '.pts') 123 #G_clipped.export_points_file(project_urs.combined_dir_name + '.txt') 124 124 125 125 print'split combined data set' … … 127 127 128 128 print'export split DEM file' 129 G_small.export_points_file(project .combined_dir_name + '_small' + '.pts')130 G_other.export_points_file(project .combined_dir_name + '_other' + '.pts')129 G_small.export_points_file(project_urs.combined_dir_name + '_small' + '.pts') 130 G_other.export_points_file(project_urs.combined_dir_name + '_other' + '.pts') 131 131 132 print 'start reading:',project .combined_smaller_dir_name + '.txt'133 G = Geospatial_data(file_name = project .combined_smaller_dir_name + '.txt')132 print 'start reading:',project_urs.combined_smaller_dir_name + '.txt' 133 G = Geospatial_data(file_name = project_urs.combined_smaller_dir_name + '.txt') 134 134 print 'start split' 135 135 G_smallest, G_other = G.split(0.1,True) 136 136 137 print 'start export',project .combined_smallest_dir_name + '.txt'138 #G.export_points_file(project .combined_smaller_dir_name + '.txt')139 #G_smallest.export_points_file(project .combined_smallest_dir_name + '.txt')137 print 'start export',project_urs.combined_smallest_dir_name + '.txt' 138 #G.export_points_file(project_urs.combined_smaller_dir_name + '.txt') 139 #G_smallest.export_points_file(project_urs.combined_smallest_dir_name + '.txt') 140 140 ''' 141 141 #------------------------------------------------------------------------- 142 142 # Convert URS to SWW file for boundary conditions 143 143 #------------------------------------------------------------------------- 144 ''' 144 145 print 'starting to create boundary conditions' 145 boundaries_in_dir_name = project .boundaries_in_dir_name146 boundaries_in_dir_name = project_urs.boundaries_in_dir_name 146 147 147 148 from anuga.shallow_water.data_manager import urs2sww 148 149 149 print 'minlat=project .north_boundary, maxlat=project.south_boundary',project.north_boundary, project.south_boundary150 print 'minlon= project .west_boundary, maxlon=project.east_boundary',project.west_boundary, project.east_boundary150 print 'minlat=project_urs.north_boundary, maxlat=project_urs.south_boundary',project_urs.north_boundary, project_urs.south_boundary 151 print 'minlon= project_urs.west_boundary, maxlon=project_urs.east_boundary',project_urs.west_boundary, project_urs.east_boundary 151 152 152 153 #import sys; sys.exit() 153 154 154 #if access(project .boundaries_dir,F_OK) == 0:155 # mkdir (project .boundaries_dir)155 #if access(project_urs.boundaries_dir,F_OK) == 0: 156 # mkdir (project_urs.boundaries_dir) 156 157 157 158 from caching import cache 158 159 cache(urs2sww, 159 160 (boundaries_in_dir_name, 160 project .boundaries_dir_name+'a'),161 project_urs.boundaries_dir_name+'a'), 161 162 {'verbose': True, 162 'minlat': project .south_boundary,163 'maxlat': project .north_boundary,164 'minlon': project .west_boundary,165 'maxlon': project .east_boundary,163 'minlat': project_urs.south_boundary, 164 'maxlat': project_urs.north_boundary, 165 'minlon': project_urs.west_boundary, 166 'maxlon': project_urs.east_boundary, 166 167 'mint': 5000, 'maxt': 35000, 167 168 # 'origin': domain.geo_reference.get_origin(), 168 # 'mean_stage': project .tide,169 # 'mean_stage': project_urs.tide, 169 170 'zscale': 1, #Enhance tsunami 170 171 'fail_on_NaN': False}, 171 172 verbose = True, 172 173 ) 173 # dependencies = source_dir + project.boundary_basename + '.sww') 174 # dependencies = source_dir + project_urs.boundary_basename + '.sww') 175 ''' 176 print 'starting to create boundary conditions' 177 from anuga.shallow_water.data_manager import urs2sww, urs_ungridded2sww 178 179 print 'boundaries_in_dir_name',project_urs.boundaries_in_dir_name 180 181 urs_ungridded2sww(project_urs.boundaries_in_dir_name, project_urs.boundaries_in_dir_name, 182 verbose=True, mint=4000, maxt=35000, zscale=1) 174 183 175 184 176 185 177 186 178
Note: See TracChangeset
for help on using the changeset viewer.