Changeset 3601
- Timestamp:
- Sep 15, 2006, 12:30:30 PM (19 years ago)
- Location:
- anuga_work/production/MOST_example/MOST_example
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/MOST_example/MOST_example/project.py
r3578 r3601 7 7 #from anuga.utilities.polygon import read_polygon 8 8 import sys 9 from anuga.pmesh.create_mesh import convert_points_from_latlon_to_utm10 9 from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees 11 10 from time import localtime, strftime … … 52 51 #Derive subdirectories and filenames 53 52 time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir 54 outputtimedir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'outputs'+sep+time+sep53 outputtimedir = time+sep 55 54 56 55 #print 'outputtimedir', outputtimedir … … 80 79 tidal_filename = tidedir + 'pt_hedland_tide.txt' 81 80 82 meshname = meshdir + basename 81 meshname = basename+time 82 mesh_elevname = basename+time+'_elev' 83 83 #onshore_dem_name = datadir + onshore_name_dted 84 84 onshore_dem_name = datadir + onshore_name_dli … … 86 86 offshore_dem_name2 = datadir + offshore_name2 87 87 coast_dem_name = datadir + coast_name 88 combined_dem_name = datadir +'pt_hedland_combined_elevation'88 combined_dem_name = 'pt_hedland_combined_elevation' 89 89 outputname = outputtimedir + basename #Used by post processing 90 90 -
anuga_work/production/MOST_example/MOST_example/run_pt_hedland.py
r3576 r3601 31 31 from anuga.pyvolution.util import Screen_Catcher 32 32 33 from anuga.fit_interpolate.fit import fit_to_mesh_file 34 33 35 # Application specific imports 34 36 import project # Definition of file names and polygons … … 47 49 48 50 # normal screen output is stored in 49 screen_output_name = project.outputtimedir + "screen_output.txt"50 screen_error_name = project.outputtimedir + "screen_error.txt"51 #screen_output_name = project.outputtimedir + "screen_output.txt" 52 #screen_error_name = project.outputtimedir + "screen_error.txt" 51 53 52 54 # used to catch screen output to file 53 sys.stdout = Screen_Catcher(screen_output_name)54 sys.stderr = Screen_Catcher(screen_error_name)55 #sys.stdout = Screen_Catcher(screen_output_name) 56 #sys.stderr = Screen_Catcher(screen_error_name) 55 57 print 'USER: ', project.user 56 58 … … 64 66 65 67 # filenames 66 meshname = project.meshname+'.msh' 68 meshname = project.meshname + '.tsh' 69 mesh_elevname = project.mesh_elevname + '.tsh' 67 70 source_dir = project.boundarydir 68 71 69 # fine data (clipping the points file to smaller area)70 # creates DEM from asc data71 convert_dem_from_ascii2netcdf(project.onshore_dem_name, use_cache=True, verbose=True)72 73 #creates pts file from DEM74 dem2pts(project.onshore_dem_name,75 easting_min=project.eastingmin,76 easting_max=project.eastingmax,77 northing_min=project.northingmin,78 northing_max= project.northingmax,79 use_cache=True,80 verbose=True)81 82 print 'create G1'83 G1 = Geospatial_data(file_name = project.offshore_dem_name1 + '.xya')84 print 'create G2'85 G2 = Geospatial_data(file_name = project.offshore_dem_name2 + '.xya')86 print 'create G3'87 G3 = Geospatial_data(file_name = project.onshore_dem_name + '.pts')88 print 'create G4'89 G4 = Geospatial_data(file_name = project.coast_dem_name + '.xya')90 print 'add G1+G2+G3+G4'91 G = G1 + G2 + G3 + G492 print 'export G'93 G.export_points_file(project.combined_dem_name + '.pts')94 72 95 73 #------------------------------------------------------------------------------- … … 101 79 from anuga.pmesh.mesh_interface import create_mesh_from_regions 102 80 103 region_res = 500000 104 coast_res = 500 105 pt_hedland_res = 5000 81 region_res = 5000000 82 coast_res = 500000 83 pt_hedland_res = 500000 106 84 interior_regions = [[project.poly_pt_hedland, pt_hedland_res], 107 85 [project.poly_region, region_res]] 108 86 109 87 print 'number of interior regions', len(interior_regions) 110 111 from anuga.utilities.polygon import plot_polygons112 if sys.platform == 'win32':113 #figname = project.outputtimedir + 'pt_hedland_polys'114 figname = 'pt_hedland_polys_test'115 plot_polygons([project.polyAll,project.poly_pt_hedland,project.poly_region],116 figname,117 verbose = True)118 88 119 89 print 'start create mesh from regions' … … 125 95 'bottom1': [4], 'bottom2': [5], 126 96 'bottom3': [6], 'right': [7]}, 127 'maximum_triangle_area': 250000,97 'maximum_triangle_area': 5000000, 128 98 'filename': meshname, 129 99 'interior_regions': interior_regions}, 130 100 verbose = True, evaluate=True) 131 101 102 cache(fit_to_mesh_file,(meshname, 103 'pt_hedland_combined_elevation_31204' + '.pts', 104 mesh_elevname), 105 {'verbose': True} 106 #,evaluate = True 107 ,verbose = False 108 ) 132 109 #------------------------------------------------------------------------------- 133 110 # Setup computational domain 134 111 #------------------------------------------------------------------------------- 135 domain = Domain(mesh name, use_cache = False, verbose = True)112 domain = Domain(mesh_elevname, use_cache = False, verbose = True) 136 113 137 114 print domain.statistics() … … 158 135 print 'hi and file',project.combined_dem_name + '.pts' 159 136 160 domain.set_quantity('elevation',161 filename = project.combined_dem_name + '.pts',162 use_cache = True,163 verbose = True,164 alpha = 0.1165 )137 #domain.set_quantity('elevation', 138 # filename = project.combined_dem_name + '.pts', 139 # use_cache = True, 140 # verbose = True, 141 # alpha = 0.1 142 # ) 166 143 167 144 #------------------------------------------------------------------------------- … … 180 157 #note only need to do when an SWW file for the MOST boundary doesn't exist 181 158 cache(ferret2sww, 182 ( source_dir +project.boundary_basename,183 source_dir +project.boundary_basename+'_'+project.basename),159 (project.boundary_basename, 160 project.boundary_basename+'_'+project.basename), 184 161 {'verbose': True, 185 162 'minlat': south, … … 190 167 'origin': domain.geo_reference.get_origin(), 191 168 'mean_stage': tide, 192 'zscale': 1 , #Enhance tsunami169 'zscale': 10, #Enhance tsunami 193 170 'fail_on_NaN': False, 194 171 'inverted_bathymetry': True}, … … 199 176 print 'Available boundary tags', domain.get_boundary_tags() 200 177 201 Bf = File_boundary( source_dir + project.boundary_basename + '.sww',178 Bf = File_boundary(project.boundary_basename+'_'+project.basename + '.sww', 202 179 domain, verbose = True) 203 180 Br = Reflective_boundary(domain)
Note: See TracChangeset
for help on using the changeset viewer.