Ignore:
Timestamp:
Jun 24, 2008, 10:24:21 AM (17 years ago)
Author:
kristy
Message:
 
Location:
anuga_work/production/busselton
Files:
4 edited

Legend:

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

    r5387 r5415  
    3737#------------------------------------------------------------------------------
    3838
    39 start_screen_catcher(project.output_build_time_dir)
    40 
    41 print 'time stamp: ',project.time
    42 print 'USER: ', project.user
    43 
    44 
    4539copy_code_files(project.output_build_time_dir,__file__,
    4640               dirname(project.__file__)+sep+ project.__name__+'.py' )
    4741
     42start_screen_catcher(project.output_build_time_dir)
    4843
     44print 'USER: ', project.user
    4945
    5046#-------------------------------------------------------------------------------
     
    5551# Fine pts file to be clipped to area of interest
    5652#-------------------------------------------------------------------------------
     53print"project.poly_all",project.poly_all
     54print"project.combined_dir_name",project.combined_dir_name
    5755
    5856# topography directory filenames
     
    6058coast_in_dir_name = project.coast_in_dir_name
    6159coast_in_dir_name1 = project.coast_in_dir_name1
    62 #island_in_dir_name = project.island_in_dir_name
    6360offshore_in_dir_name = project.offshore_in_dir_name
     61offshore_in_dir_name1 = project.offshore_in_dir_name1
     62offshore_in_dir_name2 = project.offshore_in_dir_name2
     63
    6464
    6565onshore_dir_name = project.onshore_dir_name
    6666coast_dir_name = project.coast_dir_name
    6767coast_dir_name1 = project.coast_dir_name1
    68 #island_dir_name = project.island_dir_name
    6968offshore_dir_name = project.offshore_dir_name
     69offshore_dir_name1 = project.offshore_dir_name1
     70offshore_dir_name2 = project.offshore_dir_name2
    7071
    7172# creates DEM from asc data
     
    9192G3 = Geospatial_data(file_name = coast_in_dir_name1 + '.txt',verbose=True)
    9293G_off = Geospatial_data(file_name = offshore_in_dir_name + '.txt',verbose=True)
     94G_off1 = Geospatial_data(file_name = offshore_in_dir_name1 + '.txt',verbose=True)
     95G_off2 = Geospatial_data(file_name = offshore_in_dir_name2 + '.txt',verbose=True)
    9396
    9497print'add all geospatial objects'
    95 G = G1 + G2 + G3 + G_off
     98G = G1 + G2 + G3 + G_off + G_off1 + G_off2
    9699
    97100print'clip combined geospatial object by bounding polygon'
    98 #G_clipped = G.clip(project.bounding_polygon)
    99 #FIXME: add a clip function to pts
    100 #print'shape of clipped data', G_clipped.get_data_points().shape
     101G_clipped = G.clip(project.poly_all)
    101102
    102103print'export combined DEM file'
    103104if access(project.topographies_dir,F_OK) == 0:
    104105    mkdir (project.topographies_dir)
    105 G.export_points_file(project.combined_dir_name + '.txt')
    106 #G_clipped.export_points_file(project.combined_dir_name + '.xya')
     106G_clipped.export_points_file(project.combined_dir_name + '.txt')
    107107
    108108print'project.combined_dir_name + .txt',project.combined_dir_name + '.txt'
  • anuga_work/production/busselton/export_results.py

    r5409 r5415  
    66
    77time_dir = '20080530_170705_run_final_0.6_exmouth_kvanputt'
     8time_dir = '20080619_115523_run_trial_0.6_exmouth_current_kvanputt'
     9
    810cellsize = 25
    911#cellsize = 150
    1012#timestep = 0
    1113directory = project.output_dir
    12 name = directory+time_dir+sep+project.scenario_name
     14name = directory+sep+'test'+sep+time_dir+sep+project.scenario_name
    1315
    1416from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts
  • anuga_work/production/busselton/project.py

    r5408 r5415  
    1313# file and system info
    1414#---------------------------------
     15#codename = 'project.py'
    1516
    1617home = getenv('INUNDATIONHOME') + sep +'data'+sep #Sandpit's parent dir   
    1718user = get_user_name()
    1819host = get_host_name()
     20
    1921# INUNDATIONHOME is the inundation directory, not the data directory.
    20 
    21 #needed when running using mpirun, mpirun doesn't inherit umask from .bashrc
    22 umask(002)
    2322
    2423#time stuff
    2524time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir
     25gtime = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir
    2626build_time = time+'_build'
    2727run_time = time+'_run'
    28 
    29 tide = 0.6
     28print 'gtime: ', gtime
    3029
    3130#Making assumptions about the location of scenario data
     
    3433scenario = 'busselton_tsunami_scenario'
    3534
    36 #Maybe will try to make project a class to allow these parameters to be passed in.
     35tide = 0.6
     36
    3737alpha = 0.1
    3838friction=0.01
    3939starttime=0
    40 midtime=21600
    41 #finaltime=25000
    42 finaltime=86000
     40finaltime=80000
    4341export_cellsize=25
    4442setup='final'
     
    6260    yieldstep=60
    6361
    64 dir_comment='_'+setup+'_'+str(tide)+'_'+str(source)+'_'+str(user)
    65 
    66 
    67 # onshore data provided by WA DLI
    68 #onshore_name = 'DLI_orthophoto_DEM' # original
    69 onshore_name = 'dli_dem_clipped' # original
    70 #islands
     62rev_num = 'current'
     63##rev_num = '4695' # 2nd Sept 2007
     64##rev_num = '4743' # 3nd Oct 2007
     65##rev_num = '4777' # 1st Nov 2007
     66##rev_num = '4874' # 3rd Dec 2007
     67##rev_num = '4901' # 3rd Jan 2007
     68##rev_num = '4990' # 5th Feb 2007
     69##rev_num = '5103' # 3rd March 2007
     70##rev_num = '5185' # 1st April 2007
     71##rev_num = '5273' # 2nd May 2007
     72
     73
     74dir_comment='_'+setup+'_'+str(tide)+'_'+str(source)+'_'+str(rev_num)+'_'+str(user)
     75
     76
     77# onshore data provided by WA DLI - provided by Hamish on the 17th June 2008
     78
     79onshore_name = 'busselton_v2_gda94_mga50' # original
    7180
    7281# AHO + DPI data
    73 coast_name = 'coastline_excluding_beach_survey'
    74 coast_name1 = 'bussleton_beach_data'
    75 offshore_name = 'Busselton_bathymetry'
     82coast_name = 'Contour_0' # provided by hamish, represent better coastline than the 100km as compared to charts
     83coast_name1 = 'beach_survey_final'
     84offshore_name = 'Bathymetry_final'
     85offshore_name1 = 'Busselton_Chart'
     86offshore_name2 = 'Busselton_Digitised'
    7687
    7788#final topo name
     
    8293
    8394topographies_in_dir = home+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep
    84 topographies_dir = home+state+sep+scenario+sep+'anuga'+sep+'topographies'+sep
     95topographies_dir = anuga_dir+'topographies'+sep
    8596
    8697# input topo file location
     
    89100coast_in_dir_name = topographies_in_dir + coast_name #coastline
    90101coast_in_dir_name1 = topographies_in_dir + coast_name1 #beach survey
     102
    91103offshore_in_dir_name = topographies_in_dir + offshore_name #bathymetry
     104offshore_in_dir_name1 = topographies_in_dir + offshore_name1 #bathymetry Charts
     105offshore_in_dir_name2 = topographies_in_dir + offshore_name2 #Digitised Fairsheet
    92106
    93107#output to anuga from build file
     
    96110coast_dir_name = topographies_dir + coast_name
    97111coast_dir_name1 = topographies_dir + coast_name1
     112
    98113offshore_dir_name = topographies_dir + offshore_name
     114offshore_dir_name1 = topographies_dir + offshore_name1
     115offshore_dir_name2 = topographies_dir + offshore_name2
    99116
    100117#final topo files
     
    108125tide_dir = anuga_dir+'tide_data'+sep
    109126
     127#boundaries_source = '1'
     128
    110129if source=='exmouth':
    111130    boundaries_name = 'busselton_3103_30052008' #exmouth gun
     
    114133if source=='test':
    115134    boundaries_name = 'other' #exmouth gun
    116     boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+sep
     135    boundaries_in_dir = anuga_dir+'boundaries'+sep
    117136
    118137
     
    124143#output locations
    125144output_dir = anuga_dir+'outputs'+sep
    126 output_build_time_dir = output_dir+build_time+dir_comment+sep
     145output_build_time_dir = output_dir +'test'+sep + build_time + dir_comment + sep
    127146#output_run_time_dir = output_dir +run_time+dir_comment+sep
    128 output_run_time_dir = anuga_dir+sep+'outputs'+sep+run_time+dir_comment+sep
     147output_run_time_dir = output_dir +'test'+sep + run_time + dir_comment +sep # take test out
    129148output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
    130149
    131150#gauges
    132 gauge_name = '???.csv'
     151gauge_name = 'busselton.csv'
    133152gauges_dir = home+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep
    134153gauges_dir_name = gauges_dir + gauge_name
     
    151170res_poly_all = 100000*res_factor
    152171
     172
     173###############################
     174# Interior region definitions
     175###############################
     176
     177#digitized polygons
     178poly_large = read_polygon(polygons_dir+'coast_5km_d20m.csv')
     179res_large = 1000*res_factor
     180
     181poly_busselton = read_polygon(polygons_dir+'busselton_1km.csv')
     182res_busselton = 500*res_factor
     183
     184poly_bunbury = read_polygon(polygons_dir+'bunbury_1km.csv')
     185res_bunbury = 500*res_factor
     186
     187
     188interior_regions = [[poly_large,res_large],[poly_busselton,res_busselton],[poly_bunbury,res_bunbury]]
     189
     190
     191boundary_tags={'back': [0, 1, 2, 3, 4, 9],
     192               'side': [5], 'ocean': [6, 7, 8]}
     193
     194trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
     195
     196poly_mainland=read_polygon(polygons_dir+'initial_condition.csv')
     197
     198print 'min number triangles', trigs_min
     199
     200
    153201###################################################################
    154202# Clipping regions for export to asc and regions for clipping data
    155203###################################################################
    156204
    157 # exporting asc grid
    158 eastingmin = 340000
    159 eastingmax = 350000
    160 northingmin = 6273400
    161 northingmax = 6277700
    162 
    163 ###############################
    164 # Interior region definitions
    165 ###############################
    166 
    167 #digitized polygons
    168 poly_busselton1 = read_polygon(polygons_dir+'neg20_pos10_polygon.csv')
    169 res_busselton1 = 10000*res_factor
    170 
    171 poly_busselton2 = read_polygon(polygons_dir+'neg5_pos5_poly.csv')
    172 res_busselton2 = 500*res_factor
    173 
    174 #plot_polygons([polyAll,poly_broome1,poly_broome2,poly_broome3],figname='boundingpoly2',verbose=False)
    175 
    176 interior_regions = [[poly_busselton1,res_busselton1],[poly_busselton2,res_busselton2]]
    177 print 'Hello',interior_regions
    178 
    179 boundary_tags={'back': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 14],
    180                'side': [10], 'ocean': [11, 12, 13]}
    181 
    182 trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
    183 
    184 poly_mainland=read_polygon(polygons_dir+'initial_condition.csv')
    185 
    186 print 'min number triangles', trigs_min
    187 
    188 
     205# exporting asc grid for Busselton
     206xminBusselton = 325000
     207xmaxBusselton = 360000
     208yminBusselton = 6273000
     209ymaxBusselton = 6290000
     210
     211# exporting asc grid for Busselton
     212xminBunbury = 370000
     213xmaxBunbury = 386000
     214yminBunbury = 6305000
     215ymaxBunbury = 6334000
  • anuga_work/production/busselton/run_busselton.py

    r5408 r5415  
    173173    Br = Reflective_boundary(domain)
    174174    Bd = Dirichlet_boundary([kwargs['tide'],0,0])
    175    
     175    Bo = Dirichlet_boundary([kwargs['tide']+10.0,0,0]) # To be deleted for FESA runs
    176176
    177177    Bf = Field_boundary(kwargs['boundary_file'],
     
    181181    domain.set_boundary({'back': Bd,
    182182                             'side': Bd,
    183                              'ocean': Bf})
     183                             'ocean': Bd}) #changed from Bf to Bd for large wave
    184184
    185185    kwargs['input_start_time']=domain.starttime
     
    192192    t0 = time.time()
    193193
    194     for t in domain.evolve(yieldstep = 240, finaltime = kwargs['finaltime']):
     194    for t in domain.evolve(yieldstep = project.yieldstep, finaltime = kwargs['finaltime']
     195                            ,skip_initial_step = False ):
    195196        domain.write_time()
    196         domain.write_boundary_statistics(tags = 'ocean')     
     197        domain.write_boundary_statistics(tags = 'ocean')
     198
     199        # To be deleted for FESA runs
     200        if allclose(t, 240):
     201            domain.set_boundary({'back': Br, 'side': Bd, 'ocean': Bo})
     202
     203        if allclose(t, 1440):
     204            domain.set_boundary({'back': Br, 'side': Bd, 'ocean': Bd})
     205
     206
    197207
    198208    x, y = domain.get_maximum_inundation_location()
     
    222232    kwargs['starttime']=project.starttime
    223233    kwargs['yieldstep']=project.yieldstep
    224     kwargs['midtime']=project.midtime
    225234    kwargs['finaltime']=project.finaltime
    226235   
Note: See TracChangeset for help on using the changeset viewer.