Changeset 4091
- Timestamp:
- Dec 19, 2006, 9:19:27 AM (18 years ago)
- Location:
- anuga_work/production
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/dampier_2006/project.py
r4066 r4091 203 203 n_max_area = 7725000 204 204 205 e_min_area_mom = 442200206 e_max_area_mom = 497028207 n_min_area_mom = 7720095208 n_max_area_mom = 7750500209 210 205 poly_facility = read_polygon(polygons_dir+'facility.csv') 211 206 … … 224 219 clip_poly_mid_e = read_polygon(polygons_dir+'gap_mid_e.cvs') 225 220 226 plot_polygons([bounding_polygon,poly_facility,poly_pipeline,poly_interior,poly_coast],'polys',verbose=True)227 221 #Interior regions 228 222 karratha_south = degminsec2decimal_degrees(-20,44,0) -
anuga_work/production/perth_2006/build_perth.py
r4083 r4091 57 57 print"project.bounding_polygon",project.bounding_polygon 58 58 print"project.combined_dir_name",project.combined_dir_name 59 ''' 59 60 60 # topography directory filenames 61 61 onshore_in_dir_name = project.onshore_in_dir_name … … 66 66 island_in_dir_name3 = project.island_in_dir_name3 67 67 offshore_in_dir_name = project.offshore_in_dir_name 68 offshore1_in_dir_name = project.offshore1_in_dir_name 68 69 69 70 onshore_dir_name = project.onshore_dir_name … … 76 77 77 78 # creates DEM from asc data 79 print "creates DEMs from asc data" 78 80 convert_dem_from_ascii2netcdf(onshore_in_dir_name, basename_out=onshore_dir_name, use_cache=True, verbose=True) 79 81 convert_dem_from_ascii2netcdf(island_in_dir_name, basename_out=island_dir_name, use_cache=True, verbose=True) … … 83 85 84 86 #creates pts file for onshore DEM 87 print "creates pts file for onshore DEM" 85 88 dem2pts(onshore_dir_name, 86 89 # easting_min=project.eastingmin, … … 97 100 dem2pts(island_dir_name3, use_cache=True, verbose=True) 98 101 99 print'create Geospatial data objects from topographies'102 print'create Geospatial data1 objects from topographies' 100 103 G1 = Geospatial_data(file_name = onshore_dir_name + '.pts') 104 print'create Geospatial data2 objects from topographies' 101 105 G2 = Geospatial_data(file_name = coast_in_dir_name + '.xya') 106 print'create Geospatial data3 objects from topographies' 102 107 G3 = Geospatial_data(file_name = island_dir_name + '.pts') 108 print'create Geospatial data4 objects from topographies' 103 109 G4 = Geospatial_data(file_name = island_dir_name1 + '.pts') 110 print'create Geospatial data5 objects from topographies' 104 111 G5 = Geospatial_data(file_name = island_dir_name2 + '.pts') 112 print'create Geospatial data6 objects from topographies' 105 113 G6 = Geospatial_data(file_name = island_dir_name3 + '.pts') 114 print'create Geospatial data7 objects from topographies' 106 115 G_off = Geospatial_data(file_name = offshore_in_dir_name + '.xya') 116 print'create Geospatial data8 objects from topographies' 117 G_off1 = Geospatial_data(file_name = offshore1_in_dir_name + '.xya') 107 118 108 119 print'add all geospatial objects' 109 G = G1 + G2 + G3 + G4 + G5 + G6 + G_off 120 G = G1 + G2 + G3 + G4 + G5 + G6 + G_off + G_off1 110 121 111 122 print'clip combined geospatial object by bounding polygon' … … 117 128 if access(project.topographies_dir,F_OK) == 0: 118 129 mkdir (project.topographies_dir) 119 #G_clipped.export_points_file(project.combined_dir_name + '.pts')120 G_clipped.export_points_file(project.combined_dir_name + '.xya')130 G_clipped.export_points_file(project.combined_dir_name + '.pts') 131 #G_clipped.export_points_file(project.combined_dir_name + '.xya') 121 132 122 133 ''' … … 130 141 G_all_2.export_points_file(project.combined_dir_name+'_other1' + '.xya') 131 142 132 ''' 143 133 144 #------------------------------------------------------------------------- 134 145 # Convert URS to SWW file for boundary conditions -
anuga_work/production/perth_2006/project.py
r4081 r4091 46 46 coast_name = 'waterline' 47 47 offshore_name = 'perth_bathymetry' 48 offshore1_name = 'missing_fairsheets' 48 49 49 50 #final topo name 50 51 combined_name ='perth_combined_elevation' 52 combined_smaller_name = 'perth_combined_elevation_smaller' 53 51 54 52 55 topographies_in_dir = home+sep+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep … … 63 66 coast_in_dir_name = topographies_in_dir + coast_name 64 67 offshore_in_dir_name = topographies_in_dir + offshore_name 68 offshore1_in_dir_name = topographies_in_dir + offshore1_name 65 69 66 70 onshore_dir_name = topographies_dir + onshore_name … … 76 80 combined_dir_name = topographies_dir + combined_name 77 81 combined_time_dir_name = topographies_time_dir + combined_name 82 combined_smaller_name_dir = topographies_dir + combined_smaller_name 78 83 #combined_time_dir_final_name = topographies_time_dir + combined_final_name 79 84 80 85 81 #Derive subdirectories and filenames82 86 83 87 meshes_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'meshes'+sep … … 88 92 89 93 90 boundaries_source = ' mag_9_corrected'94 boundaries_source = '????' 91 95 #boundaries locations 92 96 boundaries_in_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep+'urs'+sep+boundaries_source+sep … … 96 100 #boundaries_time_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep+build_time+sep 97 101 #boundaries_time_dir_name = boundaries_time_dir + boundaries_name #Used by post processing 98 #ideas99 #boundaries_time_dir = boundaries_in_dir+'urs'+sep+boundaries_source+sep100 102 101 103 #output locations … … 111 113 112 114 113 114 115 116 117 118 119 115 ############################### 120 116 # Domain definitions … … 123 119 124 120 bounding_polygon = read_polygon(polygons_dir+'bounding_poly.csv') 121 res_bounding = 1000000 125 122 126 123 refzone = 50 127 124 128 125 129 #Interior regions 126 ############################### 127 # Interior region definitions 128 ############################### 130 129 131 #cipma_polygon, zone = convert_from_latlon_to_utm([k0, k1, k2, k3]) 130 poly_pos20_neg20 = read_polygon(polygons_dir+'pos20_neg20pts.csv') 131 res_pos20_neg20 = 500000 132 133 poly_cbd = read_polygon(polygons_dir+'cbd_pts.csv') 134 res_cbd = 50000 135 136 poly_penguin = read_polygon(polygons_dir+'penguin_pts.csv') 137 res_penguin = 50000 132 138 #assert zone == refzone 133 139 134 poly_pos20_neg20 = read_polygon(polygons_dir+'pos20_neg20pts.csv') 140 trigs_bound = polygon_area(bounding_polygon)/res_bounding 141 trigs_pos = polygon_area(poly_pos20_neg20)/res_pos20_neg20 142 trigs_cbd = polygon_area(poly_cbd)/res_cbd 143 trigs_penguin = polygon_area(poly_penguin)/res_penguin 144 trigs_min = trigs_bound + trigs_pos + trigs_cbd + trigs_penguin 135 145 136 poly_cbd = read_polygon(polygons_dir+'cbd_pts.csv') 137 138 poly_penguin = read_polygon(polygons_dir+'penguin_pts.csv') 139 #assert zone == refzone 140 141 print "bounding_polygon", bounding_polygon 142 print 'Area of bounding poly', polygon_area(bounding_polygon)/1000000.0 143 print 'Area of pos20_neg20pts', polygon_area(poly_pos20_neg20)/1000000.0 144 print 'Area of poly_cbd', polygon_area(poly_cbd)/1000000.0 145 print 'Area of poly_penguin', polygon_area(poly_penguin)/1000000.0 146 print 'Area of bounding poly', trigs_bound 147 print 'Area of pos20_neg20pts', trigs_pos 148 print 'Area of poly_cbd', trigs_cbd 149 print 'Area of poly_penguin', trigs_penguin 150 print 'min number triangles', trigs_min 146 151 147 152 … … 149 154 # Clipping regions for export to asc and regions for clipping data 150 155 ################################################################### 151 ''' 156 152 157 # exporting asc grid 153 158 eastingmin = 406215.87 … … 156 161 northingmax = 8032834.52 157 162 158 ###############################159 # Interior region definitions160 ###############################161 163 162 # perth digitized polygons163 poly_perth1 = read_polygon(polygondir+'perth_Local_Polygon_update.csv')164 poly_perth2 = read_polygon(polygondir+'perth_Close2_update.csv')165 poly_perth3 = read_polygon(polygondir+'perth_Coast_update.csv')166 #poly_perth4 = read_polygon(polygondir+'Cable_Beach_revised.csv')167 164 168 plot_polygons([polyAll,poly_perth1,poly_perth2,poly_perth3],'boundingpoly2',verbose=False)169 print 'Area of local polygon', polygon_area(poly_perth1)/1000000.0170 print 'Area of close polygon', polygon_area(poly_perth2)/1000000.0171 print 'Area of coastal polygon', polygon_area(poly_perth3)/1000000.0172 #print 'Area of cable beach polygon', polygon_area(poly_perth4)/1000000.0173 '''174 -
anuga_work/production/perth_2006/run_perth.py
r4082 r4091 31 31 32 32 from anuga.pmesh.mesh_interface import create_mesh_from_regions 33 34 33 from anuga.geospatial_data.geospatial_data import * 35 34 from anuga.abstract_2d_finite_volumes.util import start_screen_catcher, copy_code_files 36 35 from anuga_parallel.parallel_api import distribute, numprocs, myid, barrier 36 from anuga.utilities.polygon import plot_polygons, polygon_area 37 37 38 38 # Application specific imports … … 47 47 # filenames 48 48 49 build_time = '20061107_063840_build'50 bound_time = '20061102_221245_build'51 52 49 boundaries_name = project.scenario 53 50 meshes_dir_name = project.meshes_dir_name+'.msh' 54 #source_dir = project.boundarydir55 51 #boundaries_time_dir_name = project.boundaries_time_dir_name 56 52 boundaries_dir_name = project.boundaries_dir_name … … 67 63 68 64 print 'USER: ', project.user 65 print 'min triangles', project.trigs_min, 66 print 'Note: This is generally about 20% less than the final amount' 69 67 70 68 #-------------------------------------------------------------------------- … … 76 74 77 75 if myid == 0: 76 78 77 print 'start create mesh from regions' 79 interior_regions = [[project.poly_pos20_neg20, 500000],80 [project.poly_cbd, 50000],81 [project.poly_penguin, 50000]]78 interior_regions = [[project.poly_pos20_neg20, project.res_pos20_neg20], 79 [project.poly_cbd, project.res_cbd], 80 [project.poly_penguin, project.res_penguin]] 82 81 # [project.poly_interior, 1000]] 83 82 … … 89 88 # verbose = True) 90 89 # import sys; sys.exit() 90 91 91 print 'start create mesh from regions' 92 93 92 create_mesh_from_regions(project.bounding_polygon, 94 93 boundary_tags={'back': [4], 'side': [0,3], 95 94 'ocean': [1, 2]}, 96 maximum_triangle_area= 1000000,95 maximum_triangle_area=project.res_bounding, 97 96 interior_regions=interior_regions, 98 97 # filename=meshes_time_dir_name, … … 157 156 158 157 domain.set_quantity('elevation', 159 filename = project.combined_dir_name+'.xya', 158 # filename = project.combined_dir_name+'.xya', 159 filename = project.combined_smaller_name_dir+'.xya', 160 160 use_cache = True, 161 161 verbose = True, … … 201 201 domain.set_boundary({'back': Br, 202 202 'side': Bd, 203 'ocean': B f})203 'ocean': Bd}) 204 204 print'finish set boundary' 205 205 … … 214 214 domain.write_boundary_statistics(tags = 'ocean') 215 215 if allclose(t, 120): 216 domain.set_boundary({'back': Br, 'side': B o, 'ocean': Bo})216 domain.set_boundary({'back': Br, 'side': Bd, 'ocean': Bo}) 217 217 218 218 if allclose(t, 1020): 219 domain.set_boundary({'back': Br, 'side': Bd, 'ocean': B o})219 domain.set_boundary({'back': Br, 'side': Bd, 'ocean': Bd}) 220 220 221 221
Note: See TracChangeset
for help on using the changeset viewer.