Changeset 4846
- Timestamp:
- Nov 22, 2007, 2:36:01 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/development/cocos/grid_data.py
r4832 r4846 2 2 3 3 from anuga.geospatial_data.geospatial_data import * 4 from os import sep, environ, getenv, getcwd,umask 4 5 from anuga.pmesh.mesh_interface import create_mesh_from_regions 5 6 from anuga.shallow_water import Domain 6 7 from anuga.shallow_water import Reflective_boundary 7 8 from anuga.shallow_water.data_manager import export_grid 9 from anuga.shallow_water.data_manager import start_screen_catcher, copy_code_files 8 10 from math import sqrt 11 from time import localtime, strftime, gmtime 12 13 umask(002) 14 time = strftime('%Y%m%d_%H%M%S',gmtime()) 15 16 home = getenv('INUNDATIONHOME') + sep +'data'+sep 17 output_dir = home + 'anuga_validation'+sep+'cocos'+sep+'anuga'+sep+'outputs'+sep+time+sep 18 19 copy_code_files(output_dir,__file__) 20 21 start_screen_catcher(output_dir) 9 22 10 23 data_dir='/d/ehn/4/ehn/tsunami/data/bathymetry/Cocos/bathymetry/' … … 29 42 #grid1_east_max=439850.00 30 43 #grid1_east_min=156494.00 44 grid1_res=370.4 31 45 # 32 46 #grid2_north_max=8713178.04 … … 34 48 #grid2_east_max=294652.80 35 49 #grid2_east_min=224424.96 50 grid2_res=74.08 36 51 # 37 52 #grid3_north_max=274295.91 … … 39 54 #grid3_east_max=8665112.56 40 55 #grid3_east_min=8657346.91 56 grid3_res=14.82 41 57 # 42 58 #grid4_north_max=270900.24 … … 44 60 #grid4_east_max=8659120.05 45 61 #grid4_east_min=8659120.05 62 grid4_res=2.96 46 63 47 64 poly1 = [[439850.00,8565314.80],[439850.00, 8783110.00], … … 61 78 # 4.3m2 62 79 63 res = 1 80 res = 10 64 81 #G = Geospatial_data(file_name = data_dir_name + '.txt') 65 82 #G1=G.clip(poly1) … … 67 84 68 85 69 interior_polys = [[poly2, 2740*res],[poly3,110*res],[poly4,4.3*res]]86 interior_polys = [[poly2,(grid2_res**2/2)*res],[poly3,(grid3_res**2/2)*res],[poly4,(grid4_res**2/2)*res]] 70 87 #interior_polys = [[poly4,4.3*res]] 71 88 … … 80 97 #create_mesh_from_regions(poly3, 81 98 boundary_tags={'side': [0,1,2,3]}, 82 maximum_triangle_area= 68500*res,99 maximum_triangle_area=(grid1_res**2/2)*res, 83 100 # maximum_triangle_area=110*res, 84 101 interior_regions=interior_polys, … … 113 130 114 131 domain.set_name(sww_file) 115 domain.set_datadir( data_dir)132 domain.set_datadir(output_dir) 116 133 domain.set_default_order(2) # Apply second order scheme 117 134 domain.set_minimum_storable_height(0.01) # Don't store anything less than 1cm … … 129 146 domain.write_boundary_statistics(tags = 'side') 130 147 131 export_grid( data_dir+sww_file+".sww", extra_name_out = 'grid4',132 quantities = ['elevation'], # '(xmomentum**2 + ymomentum**2)**0.5' defaults to elevation 133 timestep = None, 134 reduction = max, 135 cellsize = 2.96*sqrt(res),148 export_grid(output_dir+sww_file+".sww", extra_name_out = 'grid4', 149 quantities = ['elevation'], # '(xmomentum**2 + ymomentum**2)**0.5' defaults to elevation 150 timestep = None, 151 reduction = max, 152 cellsize = grid4_res*sqrt(res), 136 153 NODATA_value = -9999, 137 154 easting_min = 269701.45, … … 144 161 format = 'asc') 145 162 146 export_grid( data_dir+sww_file+".sww", extra_name_out = 'grid3',147 quantities = ['elevation'], # '(xmomentum**2 + ymomentum**2)**0.5' defaults to elevation 148 timestep = None, 149 reduction = max, 150 cellsize = 14.82*sqrt(res),163 export_grid(output_dir+sww_file+".sww", extra_name_out = 'grid3', 164 quantities = ['elevation'], # '(xmomentum**2 + ymomentum**2)**0.5' defaults to elevation 165 timestep = None, 166 reduction = max, 167 cellsize = grid3_res*sqrt(res), 151 168 NODATA_value = -9999, 152 169 easting_min = 266767.44, … … 159 176 format = 'asc') 160 177 161 export_grid( data_dir+sww_file+".sww", extra_name_out = 'grid2',162 quantities = ['elevation'], # '(xmomentum**2 + ymomentum**2)**0.5' defaults to elevation 163 timestep = None, 164 reduction = max, 165 cellsize = 74.08*sqrt(res),178 export_grid(output_dir+sww_file+".sww", extra_name_out = 'grid2', 179 quantities = ['elevation'], # '(xmomentum**2 + ymomentum**2)**0.5' defaults to elevation 180 timestep = None, 181 reduction = max, 182 cellsize = grid2_res*sqrt(res), 166 183 NODATA_value = -9999, 167 184 easting_min = 224424.96, … … 174 191 format = 'asc') 175 192 176 export_grid( data_dir+sww_file+".sww", extra_name_out = 'grid1',177 quantities = ['elevation'], # '(xmomentum**2 + ymomentum**2)**0.5' defaults to elevation 178 timestep = None, 179 reduction = max, 180 cellsize = 370.4*sqrt(res),193 export_grid(output_dir+sww_file+".sww", extra_name_out = 'grid1', 194 quantities = ['elevation'], # '(xmomentum**2 + ymomentum**2)**0.5' defaults to elevation 195 timestep = None, 196 reduction = max, 197 cellsize = grid1_res*sqrt(res), 181 198 NODATA_value = -9999, 182 199 easting_min = 156494.00,
Note: See TracChangeset
for help on using the changeset viewer.