Changeset 3615


Ignore:
Timestamp:
Sep 18, 2006, 5:19:25 PM (18 years ago)
Author:
sexton
Message:

updates to Hobart script(data not yet received)

Location:
anuga_work/production/hobart_2006
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/hobart_2006/project.py

    r3559 r3615  
    22"""Common filenames and locations for topographic data, meshes and outputs.
    33"""
    4 
    5 
    64
    75from os import sep, environ, getenv, getcwd
     
    6765
    6866onshore_dem_name = datadir + onshore_name
    69 offshore_dem_name = datadir + offshore_name
     67offshore_dem_name_local = datadir + offshore_name_local
     68offshore_dem_name_aho = datadir + offshore_name_fairsheets
    7069coast_dem_name = datadir + coast_name
    7170combined_dem_name = datadir + 'hobart_combined_elevation'
     
    7372outputname = outputtimedir + basename  #Used by post processing
    7473
    75 from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees
    76 from anuga.coordinate_transforms.redfearn import redfearn
     74# region to export
     75e_min_area = 500000
     76e_max_area = 540000
     77n_min_area = 5220000
     78n_max_area = 5275000
    7779
     80from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees,
     81                        convert_points_from_latlon_to_utm
     82                       
    7883# bounding box
    7984south = degminsec2decimal_degrees(-43,45,0)
     
    8287east = degminsec2decimal_degrees(148,15,0)
    8388
    84 '''
    85 # region for visualisation
    86 eminviz = 260000
    87 emaxviz = 320000
    88 nminviz = 7590000
    89 nmaxviz = 7630000
    90 '''
    91 # region to export
     89#Main Domain of Hobart: first run JS 18/9/06
     90d0 = [south, west]
     91d1 = [south, east]
     92d2 = [north, east]
     93d3 = [north, west]
    9294
    93 e_min_area = 300000
    94 e_max_area = 310000
    95 n_min_area = 7600000
    96 n_max_area = 7610000
     95polyAll, zone = convert_points_from_latlon_to_utm([d0, d1, d2, d3])
     96refzone = zone
    9797
    98 
    99 #Main Domain of Hobart: first run JS 15/9/06
    100 zone, e0, n0 = redfearn(south, west)
    101 zone, e1, n1 = redfearn(south, east)
    102 zone, e2, n2 = redfearn(north, east)
    103 zone, e3, n3 = redfearn(north, west)
    104 refzone = zone
    105 d0 = [e0, n0]
    106 d1 = [e1, n1]
    107 d2 = [e2, n2]
    108 d3 = [e3, n3]
    109 
    110 polyAll = [d0, d1, d2, d3]
    111 
    112 #Interior region - Hobart city area
    113 #from anuga.utilities.polygon import read_polygon
    114 polygonptsfile0 = polygondir + 'poly1’
    115 polygonptsfile1 = polygondir + 'poly2’
    116 northern_polygon = read_polygon(polygonptsfile0 + '.csv')
    117 southern_polygon = read_polygon(polygonptsfile1 + '.csv')
    118 
    119 i0 = [304000, 7607000]
    120 i1 = [302000, 7605000]
    121 i2 = [304000, 7603000]
    122 i3 = [307000, 7602000]
    123 i4 = [309000, 7603000]
    124 i5 = [307000, 7606000]
     98#Interior region - Hobart city area + glenorchy, Kingston
     99i0 = [517000, 5267000]
     100i1 = [517000, 5255000]
     101i2 = [520000, 5250000]
     102i3 = [522000, 5239000]
     103i4 = [524000, 5238000]
     104i5 = [526000, 5236000]
     105i6 = [530000, 5244000]
     106i7 = [530000, 5250000]
     107i7 = [534000, 5254000]
     108i7 = [520000, 5270000]
    125109
    126110poly_hobart = [i0, i1, i2, i3, i4, i5]
    127111
    128 #med res around Hobart
    129 l0 = [300000, 7610000]
    130 l1 = [285000, 7600000]
    131 l2 = [300000, 7597500]
    132 l3 = [310000, 7600000]
    133 l4 = [315000, 7610000]
     112# Tasman Peninsula
     113l0 = [550000, 5247000]
     114l1 = [550000, 5211000]
     115l2 = [583000, 5211000]
     116l3 = [583000, 5247000]
    134117
    135 poly_coast = [l0, l1, l2, l3, l4]
    136 
    137 #general coast and local area to Hobart region
    138 m0 = [270000, 7581000]
    139 m1 = [300000, 7591000]
    140 m2 = [339000, 7610000]
    141 m3 = [330000, 7630000]
    142 m4 = [290000, 7640000]
    143 m5 = [260000, 7600000]
    144 
    145 poly_region = [m0, m1, m2, m3, m4, m5]
     118poly_tasman_peninsula = [l0, l1, l2, l3]
    146119
    147120# Bruny Island
    148 poly_bruny = [b0, b1, b2, b3, b4]
     121from anuga.utilities.polygon import read_polygon
     122poly_bruny = read_polygon(polygondir+'bruny.csv')
  • anuga_work/production/hobart_2006/run_hobart.py

    r3559 r3615  
    66
    77The scenario is defined by a triangular mesh created from project.polygon,
    8 the elevation data and a simulated submarine landslide.
     8the elevation data and a tsunami wave generated by MOST.
    99
    1010Ole Nielsen and Duncan Gray, GA - 2005 and Nick Bartzis, GA - 2006
    1111"""
    12 
    13 
    1412#-------------------------------------------------------------------------------# Import necessary modules
    1513#-------------------------------------------------------------------------------
     
    6765# filenames
    6866onshore_dem_name = project.onshore_dem_name
    69 coast_points = project.coast_dem_name
    70 offshore_points = project.offshore_dem_name
    7167meshname = project.meshname+'.msh'
    7268source_dir = project.boundarydir
     
    8177
    8278#creates pts file for onshore DEM
    83 dem2pts(onshore_dem_name,
    84         easting_min=project.eastingmin,
    85         easting_max=project.eastingmax,
    86         northing_min=project.northingmin,
    87         northing_max= project.northingmax,
    88         use_cache=True,
    89         verbose=True)
    90 
    91 convert_dem_from_ascii2netcdf(islands_dem_name, use_cache=True, verbose=True)
    92 
    93 #creates pts file for islands DEM
    94 dem2pts(islands_dem_name, use_cache=True, verbose=True)
     79dem2pts(onshore_dem_name, use_cache=True, verbose=True)
    9580
    9681print'create G1'
    97 G1 = Geospatial_data(file_name = project.offshore_dem_name + '.xya')
     82G1 = Geospatial_data(file_name = project.offshore_dem_name_local + '.xya')
    9883print'create G2'
    99 G2 = Geospatial_data(file_name = project.onshore_dem_name + '.pts')
     84G2 = Geospatial_data(file_name = project.offshore_dem_name_aho + '.xya')
    10085print'create G3'
    101 G3 = Geospatial_data(file_name = project.coast_dem_name + '.xya')
    102 print'add G1+G2+G3'
    103 G = G1 + G2 + G3
     86G3 = Geospatial_data(file_name = project.onshore_dem_name + '.pts')
     87print'create G4'
     88G4 = Geospatial_data(file_name = project.coast_dem_name + '.xya')
     89print'add G1+G2+G3+G4'
     90G = G1 + G2 + G3 + G4
    10491print'export G'
    10592G.export_points_file(project.combined_dem_name + '.pts')
     
    113100from anuga.pmesh.mesh_interface import create_mesh_from_regions
    114101
    115 #new
    116 region_res = 200000
    117 coast_res = 25000
    118 hobart_res = 5000
     102# use 75 for onshore components (12.5m DEM)
     103island_res = 10000
     104hobart_res = 10000
     105peninsular_res = 10000
    119106interior_regions = [[project.poly_hobart, hobart_res],
    120                     [project.poly_coast, coast_res],
    121                     [project.poly_region, region_res]]
     107                    [project.poly_tasman_peninsula, peninsula_res],
     108                    [project.poly_bruny, island_res]]
    122109
    123110print 'number of interior regions', len(interior_regions)
     
    126113_ = cache(create_mesh_from_regions,
    127114          project.polyAll,
    128           {'boundary_tags': {'top': [0], 'topleft': [1],
    129                              'topleft1': [2], 'bottomleft': [3],
    130                              'bottom': [4], 'bottomright': [5],
    131                              'topright':[6]},
     115          {'boundary_tags': {'bottom': [0], 'right': [1],
     116                             'top': [2], 'left': [3]},
    132117           'maximum_triangle_area': 100000,
    133118           'filename': meshname,           
     
    177162print 'start ferret2sww'
    178163from anuga.pyvolution.data_manager import ferret2sww
    179 
     164'''
    180165south = project.south
    181166north = project.north
     
    209194       dependencies = source_dir + project.boundary_basename + '.sww')
    210195
    211 
     196'''
    212197print 'Available boundary tags', domain.get_boundary_tags()
    213198
    214 Bf = File_boundary(source_dir + project.boundary_basename + '.sww',
     199#Bf = File_boundary(source_dir + project.boundary_basename + '.sww',
    215200                    domain, verbose = True)
    216201Br = Reflective_boundary(domain)
     
    222207                   f=lambda t: [(60<t<480)*6, 0, 0])
    223208
    224 domain.set_boundary( {'top': Bf, 'topleft': Bf,
    225                       'topleft1': Bf, 'bottomleft': Bd,
    226                       'bottom': Br, 'bottomright': Br, 'topright': Bd} )
     209# for MOST BC
     210#domain.set_boundary( {'top': Bd, 'left': Bd,
     211#                      'bottom': Bf, 'right': Bf} )
     212
     213# for testing
     214domain.set_boundary( {'top': Bd, 'left': Bd,
     215                      'bottom': Bd, 'right': Bw} )
    227216
    228217#-------------------------------------------------------------------------------                                 
     
    234223for t in domain.evolve(yieldstep = 240, finaltime = 7200):
    235224    domain.write_time()
    236     domain.write_boundary_statistics(tags = 'top')     
     225    domain.write_boundary_statistics(tags = 'bottom')     
    237226
    238227for t in domain.evolve(yieldstep = 120, finaltime = 12600
    239228                       ,skip_initial_step = True):
    240229    domain.write_time()
    241     domain.write_boundary_statistics(tags = 'top')     
    242 
    243 for t in domain.evolve(yieldstep = 60, finaltime = 19800
    244                        ,skip_initial_step = True):
    245     domain.write_time()
    246     domain.write_boundary_statistics(tags = 'top')     
    247    
    248 for t in domain.evolve(yieldstep = 120, finaltime = 25200
    249                        ,skip_initial_step = True):
    250     domain.write_time()
    251     domain.write_boundary_statistics(tags = 'top')     
    252 
    253 for t in domain.evolve(yieldstep = 240, finaltime = 36000
    254                        ,skip_initial_step = True):
    255     domain.write_time()
    256     domain.write_boundary_statistics(tags = 'top')
     230    domain.write_boundary_statistics(tags = 'bottom')     
    257231   
    258232print 'That took %.2f seconds' %(time.time()-t0)
Note: See TracChangeset for help on using the changeset viewer.