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

Legend:

Unmodified
Added
Removed
  • 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.