Changeset 6017


Ignore:
Timestamp:
Nov 28, 2008, 11:32:55 AM (15 years ago)
Author:
kristy
Message:

restructured get_timeseries.py to fit style of all other scripts

File:
1 edited

Legend:

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

    r5702 r6017  
    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 time series of nominated "gauges".
     3Input: sww file from run_perth.py
     4       gauges project.gauge_filename
     5Output: csv files stage,speed,depth,elevation over time
     6Stored in the 'outputs_dir' folder for respective .sww file
    77
    8 Note, this script will only work if pylab is installed on the platform
    9 
     8Note:
     9Can run different sww files at the same time
     10make sure if there is a second sww file that it is placed into a folder called sww2
     11Can run different gauges at the same time - ie testing boundary index point
    1012"""
    1113
    12 from os import sep
     14from os import sep, rename, listdir, system
    1315from anuga.abstract_2d_finite_volumes.util import sww2csv_gauges,csv2timeseries_graphs
    14 
    1516import project
    1617
     18directory = project.output_dir
    1719
    18 #timestamp='20080724_121200_run_trial_0.6_polyline_alpha0.1_kvanputt'
    19 #timestamp='20080724_161830_run_final_0.6_polyline_alpha0.1_kvanputt'
    20 timestamp1='20080815_103818_run_final_0_polyline_newExtent_kvanputt'
    21 timestamp2='20080815_103708_run_final_0.6_polyline_newExtent_kvanputt'
     20##time_dir1 = '20081009_184721_run_final_0.6_68693_alpha0.1_kvanputt'
     21##time_dir2 = '20081031_120515_run_final_0_27255_alpha0.1_kvanputt'
     22time_dir3 = '20081031_120753_run_final_0.6_27283_alpha0.1_kvanputt'
     23##time_dir4 = '20081031_120642_run_final_0_27283_alpha0.1_kvanputt'
     24##time_dir5 = '20081031_120316_run_final_0_68693_alpha0.1_kvanputt'
     25##time_dir6 = '20081111_113832_run_final_0.6_27255_alpha0.1_kvanputt'
    2226
    23 timestamps = [timestamp1, timestamp2]
    24 for timestamp in timestamps:
     27time_dirs = [time_dir3] #1, time_dir2, time_dir3, time_dir4, time_dir5, time_dir6]
    2528
    26     filename1=project.output_dir+timestamp+sep+project.scenario_name+'.sww'
    27     filename2=project.output_dir+timestamp+sep+'busselton_time_38340'+sep+project.scenario_name+'_time_38340_0.sww'
     29for time_dir in time_dirs:
     30   
     31    name1 = directory+time_dir+sep+project.scenario_name
     32    #name2 = directory+time_dir+sep+project.scenario_name+'_time_39600_0'
     33    #name3 = directory+time_dir+sep+project.scenario_name+'_time_79200_0'
    2834
    29     filenames = [filename1, filename2]
    30     for filename in filenames:
     35    names = [name1] #, name2, name3]
    3136
    32         sww2csv_gauges(filename,
    33                         project.gauges_dir_name,
    34                         #project.gauges_dir_name2,
     37    for i, name in enumerate(names):
     38        gauge = project.gauges_dir_name
     39                 
     40        sww2csv_gauges(name+'.sww',gauge,
    3541                        quantities = ['stage','speed','depth','elevation'],
    3642                        verbose=True)
    37                    
     43##        for filename in listdir(time_dir):
     44##            total_filename = 'All_' + filename
     45##            if i == 0:
     46##                if filename.startswith('gauge_'):
     47##                    rename(filename,total_filename)
     48##            else:
     49##                system('cat %s %s > %s' %(total_filename,filename,total_filename))
     50##
     51       
    3852
    39    
    40 
Note: See TracChangeset for help on using the changeset viewer.