Changeset 5149


Ignore:
Timestamp:
Mar 10, 2008, 3:59:09 PM (17 years ago)
Author:
nick
Message:

update busselton

Location:
anuga_work/production/busselton
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/busselton/build_busselton.py

    r4132 r5149  
    2727from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts
    2828from anuga.geospatial_data.geospatial_data import *
    29 from anuga.abstract_2d_finite_volumes.util import start_screen_catcher, copy_code_files
     29from anuga.shallow_water.data_manager import start_screen_catcher, copy_code_files,store_parameters
    3030
    3131# Application specific imports
     
    3939start_screen_catcher(project.output_build_time_dir)
    4040
    41 print 'time stamp: ',project.gtime
     41print 'time stamp: ',project.time
    4242print 'USER: ', project.user
    4343
     
    5959onshore_in_dir_name = project.onshore_in_dir_name
    6060coast_in_dir_name = project.coast_in_dir_name
     61coast_in_dir_name1 = project.coast_in_dir_name1
    6162#island_in_dir_name = project.island_in_dir_name
    6263offshore_in_dir_name = project.offshore_in_dir_name
     
    6465onshore_dir_name = project.onshore_dir_name
    6566coast_dir_name = project.coast_dir_name
     67coast_dir_name1 = project.coast_dir_name1
    6668#island_dir_name = project.island_dir_name
    6769offshore_dir_name = project.offshore_dir_name
     
    8688
    8789print'create Geospatial data1 objects from topographies'
    88 G1 = Geospatial_data(file_name = onshore_dir_name + '.pts')
    89 G2 = Geospatial_data(file_name = coast_in_dir_name + '.xya')
    90 #G3 = Geospatial_data(file_name = island_dir_name + '.pts')
    91 G_off = Geospatial_data(file_name = offshore_in_dir_name + '.xya')
     90G1 = Geospatial_data(file_name = onshore_dir_name + '.pts',verbose=True)
     91G2 = Geospatial_data(file_name = coast_in_dir_name + '.txt',verbose=True)
     92G3 = Geospatial_data(file_name = coast_in_dir_name1 + '.txt',verbose=True)
     93#G3 = Geospatial_data(file_name = island_dir_name + '.pts',verbose=True)
     94G_off = Geospatial_data(file_name = offshore_in_dir_name + '.txt',verbose=True)
    9295
    9396print'add all geospatial objects'
    94 G = G1 + G2 + G_off
     97G = G1 + G2 + G3 + G_off
    9598
    9699print'clip combined geospatial object by bounding polygon'
     
    102105if access(project.topographies_dir,F_OK) == 0:
    103106    mkdir (project.topographies_dir)
    104 G.export_points_file(project.combined_dir_name + '.xya')
     107G.export_points_file(project.combined_dir_name + '.txt')
    105108#G_clipped.export_points_file(project.combined_dir_name + '.xya')
    106109
     110print'project.combined_dir_name + .txt',project.combined_dir_name + '.txt'
     111#G_all=Geospatial_data(file_name = project.combined_dir_name + '.txt')
     112print'split'
     113G_all_1, = G.split(.10)
     114print'export 1'
     115G_all_1.export_points_file(project.combined_dir_name+'_small' + '.txt')
     116#print'export 2'
     117#G_all_2.export_points_file(project.combined_dir_name+'_other1' + '.xya')
     118
    107119'''
    108 print'project.combined_dir_name + 1.xya',project.combined_dir_name + '1.xya'
    109 G_all=Geospatial_data(file_name = project.combined_dir_name + '1.xya')
    110 print'split'
    111 G_all_1, G_all_2 = G_all.split(.10)
    112 print'export 1'
    113 G_all_1.export_points_file(project.combined_dir_name+'_small1' + '.xya')
    114 print'export 2'
    115 G_all_2.export_points_file(project.combined_dir_name+'_other1' + '.xya')
    116 
    117 
    118120#-------------------------------------------------------------------------
    119121# Convert URS to SWW file for boundary conditions
  • anuga_work/production/busselton/project.py

    r5121 r5149  
    3232state = 'western_australia'
    3333scenario_name = 'busselton'
    34 scenario = 'busselton_tsunami_scenario_2006'
     34scenario = 'busselton_tsunami_scenario'
    3535
    3636#Maybe will try to make project a class to allow these parameters to be passed in.
     
    3939starttime=10000
    4040midtime=21600
    41 finaltime=25000
     41#finaltime=25000
     42finaltime=10000
    4243export_cellsize=50
    43 setup='final'
    44 source='test'
     44setup='trial'
     45source='other'
    4546
    4647
     
    6566
    6667# onshore data provided by WA DLI
    67 onshore_name = 'DLI_orthophoto_DEM' # original
     68#onshore_name = 'DLI_orthophoto_DEM' # original
     69onshore_name = 'dli_dem_clipped' # original
    6870#islands
    6971
    7072# AHO + DPI data
    71 coast_name = '100k_coastline'
    72 offshore_name = 'Bathymetry'
     73coast_name = 'coastline_excluding_beach_survey'
     74coast_name1 = 'beach_survey_final'
     75offshore_name = 'busselton'
    7376
    7477#final topo name
    75 combined_name ='busselton_combined_elevation.pts'
    76 combined_smaller_name = 'busselton_combined_elevation_smaller'
     78combined_name ='busselton_combined_elevation'
     79combined_name_small = 'busselton_combined_elevation_smaller'
    7780
    7881anuga_dir = home+state+sep+scenario+sep+'anuga'+sep
    7982
    80 topographies_in_dir = home+sep+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep
    81 topographies_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'topographies'+sep
     83topographies_in_dir = home+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep
     84topographies_dir = home+state+sep+scenario+sep+'anuga'+sep+'topographies'+sep
    8285
    8386#input topo file location
     
    8689
    8790coast_in_dir_name = topographies_in_dir + coast_name
     91coast_in_dir_name1 = topographies_in_dir + coast_name1
    8892offshore_in_dir_name = topographies_in_dir + offshore_name
    8993
     
    9195#island_dir_name = topographies_dir + island_name
    9296coast_dir_name = topographies_dir + coast_name
     97coast_dir_name1 = topographies_dir + coast_name1
    9398offshore_dir_name = topographies_dir + offshore_name
    9499
    95100#final topo files
    96101combined_dir_name = topographies_dir + combined_name
    97 combined_smaller_dir_name = topographies_dir + combined_smaller_name
     102combined_dir_name_small = topographies_dir + combined_name_small
    98103
    99104meshes_dir = anuga_dir+'meshes'+sep
     
    115120    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+sep
    116121
    117 if source=='test':
     122if source=='other':
    118123    boundaries_name = 'test' #exmouth gun
    119124    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+sep
     
    134139#gauges
    135140gauge_name = '???.csv'
    136 gauges_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep
     141gauges_dir = home+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep
    137142gauges_dir_name = gauges_dir + gauge_name
    138143
     
    171176poly_busselton1 = read_polygon(polygons_dir+'neg20_pos10_polygon.csv')
    172177res_busselton1 = 10000*res_factor
     178
    173179poly_busselton2 = read_polygon(polygons_dir+'neg5_pos5_poly_.csv')
    174180res_busselton2 = 500*res_factor
     
    178184interior_regions = [[poly_busselton1,res_busselton1],[poly_busselton2,res_busselton2]]
    179185
    180 boundary_tags={'back': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 14],
    181                'side': [10,13], 'ocean': [11, 12]}
     186boundary_tags={'back': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
     187               'side': [10,15], 'ocean': [12, 13, 14]}
    182188
    183189trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
  • anuga_work/production/busselton/run_busselton.py

    r5121 r5149  
    169169    #print 'Reading Boundary file',project.boundaries_dir_namea + '.sww'
    170170
    171     if project.source != 'test':
     171    print'set_boundary'
     172
     173    Br = Reflective_boundary(domain)
     174    Bd = Dirichlet_boundary([kwargs['tide'],0,0])
     175    Bo = Dirichlet_boundary([kwargs['tide']+10.0,0,0])
     176
     177    if project.source != 'other':
    172178        Bf = Field_boundary(kwargs['boundary_file'],
    173179                    domain, time_thinning=kwargs['time_thinning'], mean_stage=kwargs['tide'],
    174180                    use_cache=True, verbose=True)
    175                    
    176     kwargs['input_start_time']=domain.starttime
    177 
    178     print 'finished reading boundary file'
    179 
    180     Br = Reflective_boundary(domain)
    181     Bd = Dirichlet_boundary([kwargs['tide'],0,0])
    182     Bo = Dirichlet_boundary([kwargs['tide']+5.0,0,0])
    183 
    184 
    185     print'set_boundary'
    186 
    187     domain.set_boundary({'back': Br,
    188                          'side': Bd,
    189                          'ocean': Bf})
     181        print 'finished reading boundary file'
     182        domain.set_boundary({'back': Br,
     183                             'side': Bd,
     184                             'ocean': Bf})
     185    else:
     186        print 'set ocean'               
     187        domain.set_boundary({'back': Br,
     188                             'side': Bd,
     189                             'ocean': Bd})
     190
     191#    kwargs['input_start_time']=domain.starttime
     192
    190193    print'finish set boundary'
    191194
     
    195198    t0 = time.time()
    196199
    197     for t in domain.evolve(yieldstep = 240, finaltime = kwargs['starttime']):
     200    for t in domain.evolve(yieldstep = 240, finaltime = kwargs['finaltime']):
    198201        domain.write_time()
    199202        domain.write_boundary_statistics(tags = 'ocean')     
    200203
    201         if allclose(t, 120):
     204        if allclose(t, 240):
    202205            domain.set_boundary({'back': Br, 'side': Bd, 'ocean': Bo})
    203206
    204         if allclose(t, 720):
     207        if allclose(t, 1440):
    205208            domain.set_boundary({'back': Br, 'side': Bd, 'ocean': Bd})
    206209
     
    274277   
    275278    kwargs['output_dir']=project.output_run_time_dir
    276     kwargs['bathy_file']=project.combined_dir_name
     279    kwargs['bathy_file']=project.combined_dir_name+'.pts'
    277280#    kwargs['bathy_file']=project.combined_small_dir_name + '.pts'
    278281    kwargs['boundary_file']=project.boundaries_in_dir_name + '.sww'
Note: See TracChangeset for help on using the changeset viewer.