Changeset 5415


Ignore:
Timestamp:
Jun 24, 2008, 10:24:21 AM (16 years ago)
Author:
kristy
Message:
 
Location:
anuga_work/production
Files:
1 added
9 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   
  • anuga_work/production/perth/GetTimeseries.py

    r5409 r5415  
    11"""
    2 Generate time series of nominated "gauges" read from project.gauge_filename. This
    3 is done by first running sww2csv_gauges on two different directories to make
    4 'csv' files. Then running csv2timeseries_graphs detailing the two directories
    5 containing the csv file and produces one set of graphs in the 'output_dir' containing
    6 the details at the gauges for both these sww files.
     2Generate images of "gauges" for production run
    73
    8 Note, this script will only work if pylab is installed on the platform
     4Inputs:
     5
     6production dirs: dictionary of production directories with a
     7                 association to that simulation run, eg high tide,
     8                 low tide and MSL.
     9                   
     10Outputs:
     11
     12* figures used for report stored in the report_figure directory
    913
    1014"""
     15from os import getcwd, sep, altsep, mkdir, access, F_OK
     16import project
     17from anuga.abstract_2d_finite_volumes.util import sww2timeseries
    1118
    12 from os import sep
    13 import project
    14 from anuga.abstract_2d_finite_volumes.util import sww2csv_gauges,csv2timeseries_graphs
     19production_dirs = {'20080619_115643_run_trial_0.6_exmouth_kvanputt': ''}
    1520
    16 sww2csv_gauges('slide'+sep+'slidesource.sww',
    17                 project.gauge_filename,
    18                 quantities = ['stage','speed','depth','elevation'],
    19                 verbose=True)
    20                
    21 sww2csv_gauges('fixed_wave'+sep+'fixed_wavesource.sww',
    22                project.gauge_filename,
    23                quantities = ['stage', 'speed','depth','elevation'],
    24                verbose=True)
     21is_parallel = False
    2522
    26 try:
    27     import pylab
    28     csv2timeseries_graphs(directories_dic={'slide'+sep:['Slide',0, 0],
    29                                            'fixed_wave'+sep:['Fixed Wave',0,0]},
    30                             output_dir='fixed_wave'+sep,
    31                             base_name='gauge_',
    32                             plot_numbers='',
    33                             quantities=['stage','speed','depth'],
    34                             extra_plot_name='',
    35                             assess_all_csv_files=True,                           
    36                             create_latex=False,
    37                             verbose=True)
    38 except ImportError:
    39     #ANUGA does not rely on pylab to work
    40     print 'must have pylab installed to generate plots'
     23if is_parallel is True:
     24    no_nodes = 4
    4125   
     26if is_parallel is False:
     27   
     28    swwfiles = {}   
     29    for label_id in production_dirs.keys():
     30       
     31        file_loc = project.output_dir + label_id + sep
     32        swwfile = file_loc + project.scenario_name + '.sww'
     33        swwfiles[swwfile] = label_id
     34           
     35        texname, elev_output = sww2timeseries(swwfiles,
     36                                              project.gauges_dir_name,
     37                                              production_dirs,
     38                                              report = False,
     39                                              plot_quantity = ['stage', 'speed', 'depth'],
     40                                              generate_fig = False,
     41                                              surface = False,
     42                                              time_min = None,
     43                                              time_max = None,
     44                                              time_unit = 'mins',
     45                                              title_on = False,
     46                                              use_cache = True,
     47                                              verbose = True)
    4248
     49if is_parallel is True:                                     
     50
     51    for count in range(no_nodes):
     52        swwfiles = {}
     53        for label_id in production_dirs.keys():
     54
     55            file_loc = project.output_dir + label_id + sep
     56            extra = '_P%i_%i' %(count,no_nodes)
     57            swwfile = file_loc + project.scenario_name + extra + '.sww'
     58            swwfiles[swwfile] = label_id
     59
     60            texname, elev_output = sww2timeseries(swwfiles,
     61                                                  project.gauges_dir_name,
     62                                                  production_dirs,
     63                                                  report = False,
     64                                                  plot_quantity = ['stage', 'speed'],
     65                                                  generate_fig = False,
     66                                                  surface = False,
     67                                                  time_min = None,
     68                                                  time_max = None,
     69                                                  time_unit = 'mins',
     70                                                  title_on = False,
     71                                                  use_cache = True,
     72                                                  verbose = True)
     73                                     
  • anuga_work/production/perth/export_results.py

    r5409 r5415  
    66
    77#time_dir = '20080526_104946_run_final_0.6_test_kvanputt'
    8 time_dir = '20080530_170833_run_final_0.6_exmouth_kvanputt'
    9 
     8#time_dir = '20080530_170833_run_final_0.6_exmouth_kvanputt'
     9time_dir = '20080619_115643_run_trial_0.6_exmouth_kvanputt'
    1010
    1111cellsize = 25
  • anuga_work/production/perth/export_results_all.py

    r5409 r5415  
    77#time_dir = '20080526_104946_run_final_0.6_test_kvanputt'
    88#time_dir = '20080530_170833_run_final_0.6_exmouth_kvanputt'
    9 time_dir = '20080612_102742_run_final_0.6_exmouth_kvanputt'
     9time_dir = '20080619_115643_run_trial_0.6_exmouth_kvanputt'
    1010
    1111
    1212
    13 cellsize = 25
     13cellsize = 10
    1414#cellsize = 150
    15 #timestep = 0
     15timestep = 0
    1616directory = project.output_dir
    1717name = directory+time_dir+sep+project.scenario_name
     
    5353        northing_max = project.ymaxRockingham
    5454
    55     var = [2,3,4] # depth and speed
     55   # var = [2,3,4] # depth and speed
    5656#var = [2] # depth
    57 #var = [4]
     57    var = [0,4]
    5858
    5959    for which_var in var:
     
    8686                sww2dem(namei, basename_out = outnamei,
    8787                            quantity = quantityname,
    88                             #timestep = timestep,
     88                            timestep = timestep,
    8989                            cellsize = cellsize,     
    9090                            easting_min = project_grad.e_min_area,
     
    9999            sww2dem(name, basename_out = outname,
    100100                        quantity = quantityname,
    101                         #timestep = timestep,
     101                        timestep = timestep,
    102102                        cellsize = cellsize,     
    103103                        easting_min = easting_min,
  • anuga_work/production/perth/project.py

    r5408 r5415  
    3737alpha = 0.1
    3838friction=0.01
    39 starttime=10000
     39starttime=0
    4040finaltime=80000
    41 export_cellsize=50
    42 setup='final'
     41export_cellsize=25
     42setup='trial'
    4343source='exmouth'
    4444
     
    143143#gauges
    144144gauge_name = 'perth.csv'
    145 gauges_dir = anuga_dir+'gauges'+sep
     145
     146gauges_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep
     147beach_gauges = gauges_dir + 'beach_gauges.csv'
    146148gauges_dir_name = gauges_dir + gauge_name
    147149
  • anuga_work/production/perth/run_perth.py

    r5408 r5415  
    193193    t0 = time.time()
    194194
    195     for t in domain.evolve(yieldstep = 240, finaltime = kwargs['finaltime']
    196                        ,skip_initial_step = True):
     195    for t in domain.evolve(yieldstep = project.yieldstep, finaltime = kwargs['finaltime']
     196                       ,skip_initial_step = False):
    197197        domain.write_time()
    198198        domain.write_boundary_statistics(tags = 'ocean')   
Note: See TracChangeset for help on using the changeset viewer.