Changeset 3249
- Timestamp:
- Jun 28, 2006, 9:29:41 AM (19 years ago)
- Location:
- production/onslow_2006
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
production/onslow_2006/project.py
r3188 r3249 3 3 """ 4 4 5 from os import sep, environ 5 from os import sep, environ, getenv, getcwd 6 6 from os.path import expanduser 7 7 from utilities.polygon import read_polygon … … 12 12 from coordinate_transforms.redfearn import degminsec2decimal_degrees 13 13 14 from time import localtime, strftime 15 16 from os import getcwd 14 from time import localtime, strftime, gmtime 17 15 18 16 #Making assumptions about the location of scenario data … … 35 33 36 34 if sys.platform == 'win32': 37 home = environ['INUNDATIONHOME'] #Sandpit's parent dir 38 comparehome = environ['ANUGAHOME'] 35 home = getenv('INUNDATIONHOME') 36 # python_home = getenv('PWD') 37 # home = environ['INUNDATIONHOME'] #Sandpit's parent dir 38 user = getenv('USERPROFILE') 39 # user = basename(user_path) 40 print 'USER:', user 41 39 42 else: 40 home = environ['INUNDATIONHOME'] #Sandpit's parent dir 41 # home = expanduser('~') 43 home = getenv('INUNDATIONHOME', sep+'d'+sep+'cit'+sep+'1'+sep+'cit'+sep+'risk_assessment_methods_project'+sep+'inundation') 44 user = getenv('LOGNAME') 45 print 'USER:', user 42 46 43 47 #Derive subdirectories and filenames 44 time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir 45 outputtimedir = home+sep+scenario_dir_name+sep+'output'+sep+time+sep 48 #time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir 49 local_time = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir 50 46 51 meshdir = home+sep+scenario_dir_name+sep+'meshes'+sep 47 52 datadir = home+sep+scenario_dir_name+sep+'topographies'+sep … … 52 57 outputdir = home+sep+scenario_dir_name+sep+'output'+sep 53 58 tidedir = home+sep+scenario_dir_name+sep+'tide_data'+sep 54 comparereportdir = comparehome+sep+'documentation'+sep+'experimentation'+sep+'boundary_ANUGA_MOST'+sep+'report' 55 comparereportfigdir = comparehome+sep+'documentation'+sep+'experimentation'+sep+'boundary_ANUGA_MOST'+sep+'report_figures' 59 60 outputtimedir = outputdir + local_time + sep 61 56 62 print'bound', boundarydir 57 63 … … 81 87 codedirname = codedir + 'project.py' 82 88 83 meshname = meshdir + basename 84 89 #meshname = meshdir + basename 90 meshname = outputtimedir + 'mesh_' + basename 91 print 'meshname',meshname 85 92 coarsedemname = datadir + coarsename 86 93 … … 138 145 #Interior region - Onslow town 139 146 147 #first run! 140 148 #i0 = [304000, 7608000] 141 i0 = [304000, 7607000] 142 i1 = [302000, 7605000] 149 #i1 = [302000, 7605000] 143 150 #i2 = [303000, 7602000] 151 #i3 = [305000, 7601000] 152 #i4 = [309000, 7603000] 153 #i5 = [307000, 7606500] 154 155 #refined run 156 #i0 = [304000, 7607000] 157 #i1 = [302000, 7605000] 158 #i2 = [304000, 7603000] 159 #i3 = [307000, 7602000] 160 #i4 = [309000, 7603000] 161 #i5 = [307000, 7606000] 162 163 #for visualisation 164 i0 = [304000, 7609000] 165 i1 = [301500, 7605000] 144 166 i2 = [304000, 7603000] 145 #i3 = [305000, 7601000]146 167 i3 = [307000, 7602000] 147 168 i4 = [309000, 7603000] 148 #i5 = [307000, 7606500] 149 i5 = [307000, 7606000] 169 i5 = [311000, 7607000] 170 171 150 172 151 173 poly_onslow = [i0, i1, i2, i3, i4, i5] … … 189 211 190 212 poly_region = [m0, m1, m2, m3, m4, m5] 191 192 from coordinate_transforms.redfearn import redfearn193 # boundary up to 50 m contour194 lat1_50 = degminsec2decimal_degrees(-21,30,0)195 lat2_50 = degminsec2decimal_degrees(-21,25,0)196 lat3_50 = degminsec2decimal_degrees(-21,12,0)197 lat4_50 = degminsec2decimal_degrees(-21,0,0)198 lon1_50 = degminsec2decimal_degrees(114,40,0)199 lon2_50 = degminsec2decimal_degrees(114,49,0)200 lon3_50 = degminsec2decimal_degrees(115,1,0)201 lon4_50 = degminsec2decimal_degrees(115,9,0)202 z, easting, northing = redfearn(lat1_50, lon1_50)203 p0_50 = [easting, northing]204 z, easting, northing = redfearn(lat2_50, lon2_50)205 p1_50 = [easting, northing]206 z, easting, northing= redfearn(lat3_50, lon3_50)207 p2_50 = [easting, northing]208 z, easting, northing = redfearn(lat4_50, lon4_50)209 p3_50 = [easting, northing]210 211 d4_50 = [285000, 7585000]212 d6_50 = [330000, 7605000]213 bounding_poly50 = [p0_50, p1_50, p2_50, p3_50, d6_50, d5, d4_50]214 215 # boundary up to 25 m contour216 lat1_25 = degminsec2decimal_degrees(-21,30,0)217 lat2_25 = degminsec2decimal_degrees(-21,24,0)218 lat3_25 = degminsec2decimal_degrees(-21,3,0)219 lon1_25 = degminsec2decimal_degrees(114,46,0)220 lon2_25 = degminsec2decimal_degrees(114,53,0)221 lon3_25 = degminsec2decimal_degrees(115,9,0)222 z, easting, northing = redfearn(lat1_25, lon1_25)223 p0_25 = [easting, northing]224 z, easting, northing = redfearn(lat2_25, lon2_25)225 p1_25 = [easting, northing]226 z, easting, northing = redfearn(lat3_25, lon3_25)227 p2_25 = [easting, northing]228 bounding_poly25 = [p0_25, p1_25, p2_25, d6, d5, d4] -
production/onslow_2006/run_onslow.py
r2956 r3249 88 88 # print' most file', project.MOST_dir + project.boundary_basename 89 89 90 """ 90 ''' 91 91 # fine data (clipping the points file to smaller area) 92 92 # creates DEM from asc data … … 113 113 print'export G' 114 114 G.export_points_file(project.combined_dem_name + '.pts') 115 """ 115 ''' 116 116 117 117 #------------------------------------------------------------------------------- … … 122 122 123 123 from pmesh.mesh_interface import create_mesh_from_regions 124 124 ''' 125 # original 126 interior_res = 5000 127 high_res = 1500 128 interior_regions = [[project.poly_onslow, high_res], 129 [project.poly_thevenard, interior_res], 130 [project.poly_coast, interior_res]] 131 ''' 125 132 #new 126 region_res = 50000127 coast_res = 2500 133 region_res = 25000 134 coast_res = 25000 128 135 onslow_res = 500 129 136 interior_regions = [[project.poly_onslow, onslow_res], 130 [project.poly_coast, coast_res]] 131 #, 137 [project.poly_coast, coast_res]]#, 132 138 # [project.poly_region, region_res]] 133 139 … … 141 147 'bottom': [4], 'bottomright': [5], 142 148 'topright':[6]}, 143 'maximum_triangle_area': 100000 0,149 'maximum_triangle_area': 100000, 144 150 'filename': meshname, 145 151 'interior_regions': interior_regions}, 146 verbose = True )152 verbose = True, evaluate=True) 147 153 148 154 … … 235 241 'inverted_bathymetry': True}, 236 242 #evaluate = True, 237 verbose = True )243 verbose = True, evaluate=True) 238 244 239 245 … … 260 266 t0 = time.time() 261 267 262 for t in domain.evolve(yieldstep = 240, finaltime = 7200):268 for t in domain.evolve(yieldstep = 450, finaltime = 10800): 263 269 domain.write_time() 264 270 domain.write_boundary_statistics(tags = 'top') 265 271 266 for t in domain.evolve(yieldstep = 120, finaltime = 12600272 for t in domain.evolve(yieldstep = 60, finaltime = 17760 267 273 ,skip_initial_step = True): 268 274 domain.write_time() 269 275 domain.write_boundary_statistics(tags = 'top') 270 276 271 for t in domain.evolve(yieldstep = 60, finaltime = 19800277 for t in domain.evolve(yieldstep = 480, finaltime = 36000 272 278 ,skip_initial_step = True): 273 279 domain.write_time() 274 280 domain.write_boundary_statistics(tags = 'top') 275 281 276 for t in domain.evolve(yieldstep = 120, finaltime = 25200277 ,skip_initial_step = True):278 domain.write_time()279 domain.write_boundary_statistics(tags = 'top')280 281 for t in domain.evolve(yieldstep = 240, finaltime = 36000282 ,skip_initial_step = True):283 domain.write_time()284 domain.write_boundary_statistics(tags = 'top')285 282 286 283 print 'That took %.2f seconds' %(time.time()-t0)
Note: See TracChangeset
for help on using the changeset viewer.