Ignore:
Timestamp:
Aug 5, 2008, 9:50:22 AM (16 years ago)
Author:
Leharne
Message:

Update project_truescale.py to include x&y extents for export_results.py

Location:
anuga_work/development/convergence_okushiri_2008
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/development/convergence_okushiri_2008/project_truescale.py

    r5411 r5604  
    4343run_time = time+'_run'
    4444
     45# Set anuga input directory names
     46
     47anuga_dir = join(home,'anuga')+sep
     48
     49mesh_dir = join(anuga_dir, 'meshes')+sep
     50mesh_name = join(mesh_dir, 'okushiri_truescale')
     51
     52polygons_dir = join(anuga_dir, 'polygons')+sep # Created with ArcGIS (csv files)
     53
     54#------------------------
    4555# Run parameters
     56#------------------------
     57
    4658finaltime=450
    47 setup='original'
    48 
     59setup='sixteen'
     60polygons = 'contour_polygons'
     61
     62if setup =='no polygons':
     63    print 'no interior polygons'
     64    base_resolution=1
     65    yieldstep=1
     66if setup =='octuple':
     67    print '8 times original resolution'
     68    base_resolution=0.125
     69    yieldstep=1
     70if setup =='sixteen':
     71    print '16 times original resolution'
     72    base_resolution=0.0625
     73    yieldstep=1
     74if setup =='quadruple':
     75    print '4 times original resolution'
     76    base_resolution=0.25
     77    yieldstep=1
     78if setup =='double':
     79    print 'double original resolution'
     80    base_resolution=0.5
     81    yieldstep=1
     82if setup =='1.5':
     83    print '1.5 times original resolution'
     84    base_resolution=0.66
     85    yieldstep=1
    4986if setup =='original':
    5087    print 'original resolution'
    5188    base_resolution=1
    5289    yieldstep=1
    53 if setup =='double':
    54     print 'double original resolution'
    55     base_resolution=0.5
     90if setup =='0.75':
     91    print '0.75 times original resolution'
     92    base_resolution=1.33
    5693    yieldstep=1
    5794if setup =='half':
     
    5996    base_resolution=2
    6097    yieldstep=1
    61 if setup =='no polygons':
    62     print 'half original resolution'
    63     base_resolution=2
     98if setup =='quarter':
     99    print '1/4 original resolution'
     100    base_resolution=4
     101    yieldstep=1
     102if setup =='eighth':
     103    print '1/8 original resolution'
     104    base_resolution=8
     105    yieldstep=1
     106if setup =='sixteenth':
     107    print '1/16 original resolution'
     108    base_resolution=16
     109    yieldstep = 1
     110if setup =='1-32':
     111    print '1/32 original resolution'
     112    base_resolution=32
     113    yieldstep=1
     114if setup =='1-64':
     115    print '1/64 original resolution'
     116    base_resolution=64
    64117    yieldstep=1
    65118 
     119 
     120#------------------------------
     121# Polygon definitions
     122#------------------------------
    66123   
    67 # Set anuga directories
    68 anuga_dir = join(home,'anuga')+sep
    69 
    70 dir_comment='_'+setup+'_'+str(user)
    71 
    72 mesh_dir = join(anuga_dir, 'meshes')+sep
    73 mesh_name = join(mesh_dir, 'okushiri_truescale')
    74 
    75 polygons_dir = join(anuga_dir, 'polygons')+sep # Created with ArcGIS (csv files)
    76 
    77 # Output locations
     124poly_all = read_polygon(polygons_dir+'bounding_polygon.csv')
     125res_poly_all = 16000*base_resolution
     126
     127# Original polygon definitions
     128
     129poly_gulleys = read_polygon(polygons_dir+'gulleys_polygon.csv')
     130res_gulleys = 3.2*base_resolution
     131
     132poly_island = read_polygon(polygons_dir+'island_polygon.csv')
     133res_island = 32*base_resolution
     134
     135poly_rhs = read_polygon(polygons_dir+'rhs_polygon.csv')
     136res_rhs = 80*base_resolution
     137
     138                   
     139# Contour-based polygon definitions
     140
     141poly_25 = read_polygon(polygons_dir+'polygon_25m.csv')
     142res_poly_25 = 800*base_resolution
     143
     144poly_10 = read_polygon(polygons_dir+'polygon_10m.csv')
     145res_poly_10 = 80*base_resolution
     146
     147poly_5 = read_polygon(polygons_dir+'polygon_5m.csv')
     148res_poly_5 = 32*base_resolution
     149
     150poly_1 = read_polygon(polygons_dir+'polygon_1m.csv')
     151res_poly_1 = 10*base_resolution
     152
     153                   
     154if polygons =='original_polygons':
     155    print 'original polygon definition'
     156    interior_regions = [[poly_gulleys,res_gulleys],[poly_island,res_island],
     157                    [poly_rhs,res_rhs]]
     158
     159if polygons =='contour_polygons':
     160    print 'contour-based polygon definition'
     161    interior_regions = [[poly_25,res_poly_25],[poly_10,res_poly_10],
     162                    [poly_5,res_poly_5],[poly_1,res_poly_1] ]
     163
     164
     165trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
     166print 'min number triangles', trigs_min
     167
     168this_area = polygon_area(poly_all)
     169print this_area
     170
     171
     172# Polygon QC
     173#polygon_plot='polygons.png'
     174#plot_polygons([poly_all, poly_25, poly_10, poly_5, poly_1], style=None, figname=polygon_plot)
     175
     176
     177#--------------------------------
     178# Set anuga output locations
     179#--------------------------------
     180
     181# Directory comment
     182dir_comment='_'+setup+'_'+polygons+'_'+str(user)
     183
    78184output_dir = join(anuga_dir, 'outputs')+sep
    79185output_run_time_dir = output_dir+run_time+dir_comment+sep
     
    86192
    87193# Vertex coordinates
    88 vertex_filename = output_run_time_dir+setup+'vertex_coordinates.txt'
    89 
    90 #------------------------------
    91 # Polygon definitions
    92 #------------------------------
    93 
    94 poly_all = read_polygon(polygons_dir+'bounding_polygon.csv')
    95 res_poly_all = 16000*base_resolution
    96 
    97 #print 'Area of bounding polygon', polygon_area(poly_all)/1000000.0
    98 
    99 poly_gulleys = read_polygon(polygons_dir+'gulleys_polygon.csv')
    100 res_gulleys = 3.2*base_resolution
    101 
    102 poly_island = read_polygon(polygons_dir+'island_polygon.csv')
    103 res_island = 32*base_resolution
    104 
    105 poly_rhs = read_polygon(polygons_dir+'rhs_polygon.csv')
    106 res_rhs = 80*base_resolution
    107 
    108 interior_regions = [[poly_gulleys,res_gulleys],[poly_island,res_island],
    109                     [poly_rhs,res_rhs]]
    110                    
    111 trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
    112 
    113 print 'min number triangles', trigs_min
    114 
    115 
    116 
    117 
    118 
    119 
     194vertex_filename = output_run_time_dir+'vertex_coordinates.txt'
     195
     196
     197#--------------------------------
     198# Area definitions for sww2dem
     199#--------------------------------
     200
     201xminDeep = 0
     202xmaxDeep = 1000
     203yminDeep = 0
     204ymaxDeep = 1360.8
     205
     206xminMid = 1000
     207xmaxMid = 1700
     208yminMid = 0
     209ymaxMid = 1360.8
     210
     211xminShallow = 1700
     212xmaxShallow = 2179.2
     213yminShallow = 0
     214ymaxShallow = 1360.8
     215
     216
     217
     218
     219
Note: See TracChangeset for help on using the changeset viewer.