- Timestamp:
- Sep 1, 2008, 2:25:29 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/development/convergence_okushiri_2008/export_results.py
r5604 r5720 1 1 import project_truescale, os 2 2 import sys 3 import time 3 4 from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts 4 5 from anuga.shallow_water.data_manager import sww2dem 6 from anuga.geospatial_data.geospatial_data import * 5 7 from os import sep 6 8 … … 15 17 res_dir9 = '20080715_015727_run_1-32_contour_polygons_lfountai' 16 18 res_dir10 = '20080721_015521_run_1-64_contour_polygons_lfountai' 17 res_dirs = [#res_dir1, res_dir2, res_dir3, res_dir4, res_dir5, res_dir6, res_dir7, res_dir8, 18 res_dir9, res_dir10] 19 res_dirs = [res_dir1, #res_dir2, res_dir3, res_dir4, res_dir5, res_dir6, res_dir7, res_dir8,res_dir9, 20 res_dir10] 21 #timesteps = [200, 250, 300, 350, 400, 450] 22 timesteps = [327] #this is time of maximum inundation 23 19 24 20 25 for res_dir in res_dirs: 21 26 22 #timestep = 0 23 directory = project_truescale.output_dir+res_dir+sep 24 name = directory+'okushiri_truescale' 27 for timestep in timesteps: 28 29 directory = project_truescale.output_dir+res_dir+sep 30 name = directory+'okushiri_truescale' 25 31 26 is_parallel = False27 #is_parallel = True32 is_parallel = False 33 #is_parallel = True 28 34 29 if is_parallel == True: nodes = 1030 print 'output directory:', directory35 if is_parallel == True: nodes = 10 36 print 'output directory:', directory 31 37 32 area = ['Deep', 'Mid', 'Shallow'] 38 area = ['Deep', 'Mid', 'Shallow'] 39 40 for which_area in area: 41 if which_area == 'Deep': 42 cellsize = 50 43 easting_min = project_truescale.xminDeep 44 easting_max = project_truescale.xmaxDeep 45 northing_min = project_truescale.yminDeep 46 northing_max = project_truescale.ymaxDeep 33 47 34 for which_area in area: 35 if which_area == 'Deep': 36 cellsize = 50 37 easting_min = project_truescale.xminDeep 38 easting_max = project_truescale.xmaxDeep 39 northing_min = project_truescale.yminDeep 40 northing_max = project_truescale.ymaxDeep 48 if which_area == 'Mid': 49 cellsize = 25 50 easting_min = project_truescale.xminMid 51 easting_max = project_truescale.xmaxMid 52 northing_min = project_truescale.yminMid 53 northing_max = project_truescale.ymaxMid 41 54 42 if which_area == 'Mid':43 cellsize = 2544 easting_min = project_truescale.xminMid45 easting_max = project_truescale.xmaxMid46 northing_min = project_truescale.yminMid47 northing_max = project_truescale.ymaxMid55 if which_area == 'Shallow': 56 cellsize = 10 57 easting_min = project_truescale.xminShallow 58 easting_max = project_truescale.xmaxShallow 59 northing_min = project_truescale.yminShallow 60 northing_max = project_truescale.ymaxShallow 48 61 49 if which_area == 'Shallow': 50 cellsize = 10 51 easting_min = project_truescale.xminShallow 52 easting_max = project_truescale.xmaxShallow 53 northing_min = project_truescale.yminShallow 54 northing_max = project_truescale.ymaxShallow 62 ## which_area='all' 63 ## easting_min=0 64 ## easting_max=2179.2 65 ## northing_min=0 66 ## northing_max=1360.8 67 ## cellsize=10 68 69 70 var = [2] 71 72 for which_var in var: 73 if which_var == 0: # Stage 74 outname = directory + which_area + '_stage_' + str(timestep) 75 quantityname = 'stage' 76 77 if which_var == 1: # Absolute Momentum 78 outname = directory + which_area + '_momentum_' + str(timestep) 79 quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 80 81 if which_var == 2: # Depth 82 outname = directory + which_area + '_depth_' + str(timestep) 83 quantityname = 'stage-elevation' 84 85 if which_var == 3: # Speed 86 outname = directory + which_area + '_speed_' + str(timestep) 87 quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))' #Speed 88 89 if which_var == 4: # Elevation 90 outname = directory + which_area + '_elevation_' + str(timestep) 91 quantityname = 'elevation' 92 93 ## if is_parallel == True: 94 ## # print 'is_parallel',is_parallel 95 ## for i in range(0,nodes): 96 ## namei = name + '_P%d_%d' %(i,nodes) 97 ## outnamei = outname + '_P%d_%d' %(i,nodes) 98 ## print 'start sww2dem for sww file %d' %(i) 99 ## sww2dem(namei, basename_out = outnamei, 100 ## quantity = quantityname, 101 ## timestep = timestep, 102 ## cellsize = cellsize, 103 ## easting_min = project_grad.e_min_area, 104 ## easting_max = project_grad.e_max_area, 105 ## northing_min = project_grad.n_min_area, 106 ## northing_max = project_grad.n_max_area, 107 ## reduction = max, 108 ## verbose = True, 109 ## format = 'asc') 110 ## else: 111 112 113 print 'start sww2dem', which_area 114 sww2dem(name, basename_out = outname, 115 quantity = quantityname, 116 timestep = timestep, 117 cellsize = cellsize, 118 easting_min = easting_min, 119 easting_max = easting_max, 120 northing_min = northing_min, 121 northing_max = northing_max, 122 reduction = max, 123 verbose = True, 124 format = 'ers') 55 125 56 126 57 # var = [2,3,4] # depth and speed 58 #var = [2] # depth 59 var = [0,4] 60 61 for which_var in var: 62 if which_var == 0: # Stage 63 outname = directory + which_area + '_stage' 64 quantityname = 'stage' 65 66 if which_var == 1: # Absolute Momentum 67 outname = directory + which_area + '_momentum' 68 quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 69 70 if which_var == 2: # Depth 71 outname = directory + which_area + '_depth' 72 quantityname = 'stage-elevation' 73 74 if which_var == 3: # Speed 75 outname = directory + which_area + '_speed' 76 quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))' #Speed 77 78 if which_var == 4: # Elevation 79 outname = directory + which_area + '_elevation' 80 quantityname = 'elevation' 81 82 ## if is_parallel == True: 83 ## # print 'is_parallel',is_parallel 84 ## for i in range(0,nodes): 85 ## namei = name + '_P%d_%d' %(i,nodes) 86 ## outnamei = outname + '_P%d_%d' %(i,nodes) 87 ## print 'start sww2dem for sww file %d' %(i) 88 ## sww2dem(namei, basename_out = outnamei, 89 ## quantity = quantityname, 90 ## timestep = timestep, 91 ## cellsize = cellsize, 92 ## easting_min = project_grad.e_min_area, 93 ## easting_max = project_grad.e_max_area, 94 ## northing_min = project_grad.n_min_area, 95 ## northing_max = project_grad.n_max_area, 96 ## reduction = max, 97 ## verbose = True, 98 ## format = 'asc') 99 ## else: 100 print 'start sww2dem', which_area 101 sww2dem(name, basename_out = outname, 102 quantity = quantityname, 103 #timestep = timestep, 104 cellsize = cellsize, 105 easting_min = easting_min, 106 easting_max = easting_max, 107 northing_min = northing_min, 108 northing_max = northing_max, 109 reduction = max, 110 verbose = True, 111 format = 'ers') 112 127 ##convert_dem_from_ascii2netcdf(outname, use_cache=True, verbose=True) 128 ##dem2pts(outname, use_cache=True, verbose=True) 129 ##G = Geospatial_data(file_name = outname + '.pts') 130 ##G.export_points_file('test' + '.txt')
Note: See TracChangeset
for help on using the changeset viewer.