source: anuga_work/production/dampier_2006/get_timeseries.py @ 4422

Last change on this file since 4422 was 4422, checked in by nick, 17 years ago

good version of dampier and update the export_results.py

File size: 4.1 KB
Line 
1"""
2Generate images of "gauges" for production run
3
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
13
14"""
15from os import getcwd, sep, altsep, mkdir, access, F_OK
16import project
17from anuga.abstract_2d_finite_volumes.util import sww2timeseries
18
19# Create report directory
20reportdir = getcwd()+sep+'report'+sep
21if access(reportdir,F_OK) == 0:
22    mkdir (reportdir)
23   
24# sww file created from URS boundary
25production_dirs = {#'boundaries': '10000 yr wave height'
26                   '20070418_035124_run': 'URS boundary normal'
27                   }
28
29   
30is_parallel = False
31if is_parallel == True:
32    nodes = 8
33   
34# Generate figures
35swwfiles = {}
36
37#J:\inundation\data\western_australia\onslow_tsunami_scenario_2006\anuga\boundaries SU-AU_high_res1.sww
38
39#boundary_dir_filename= os.path.join(home,data,state,'onslow_tsunami_scenario_2006',an,bo,'SU-AU_high_res1.sww')
40#gauges_dir_name_simple =
41if is_parallel is True:
42    print 'bugger'
43   
44    for i in range(nodes):
45        print 'Sending node %d of %d' %(i,nodes)
46        swwfiles = {}
47        #reportname = report_name + '_%s' %(i)
48        for label_id in production_dirs.keys():
49            if label_id == 'boundaries':
50#                file_loc = project.boundaries_in_dir
51                swwfile = best_boundary_sww
52                print 'hi'
53            else:
54                file_loc = project.output_dir + label_id + sep
55                sww_extra = '_P%s_%s' %(i,nodes)
56                swwfile = file_loc + project.scenario_name + sww_extra + '.sww'
57                print 'swwfile',swwfile
58            swwfiles[swwfile] = label_id
59
60        texname, elev_output = sww2timeseries(swwfiles,
61                                              project.gauges_dir_name_simple,
62                                              production_dirs,
63                                              report = False,
64                                              #reportname = reportname,
65                                              plot_quantity = ['stage', 'momentum'],
66                                              generate_fig = False,
67                                              surface = False,
68                                              time_min = None,
69                                              time_max = None,
70                                              title_on = False,
71                                              verbose = True)
72           
73            #latex_output.append(texname)
74   
75
76else:
77   
78    for label_id in production_dirs.keys():
79       
80        if label_id == 'boundaries':
81                print 'boundaries'
82                file_loc = project.boundaries_in_dir
83                swwfile = project.boundaries_dir_name3 + '.sww'
84#                swwfile = boundary_dir_filename
85        else:
86            file_loc = project.output_dir + label_id + sep
87            swwfile = file_loc + project.scenario_name + '.sww'
88        swwfiles[swwfile] = label_id
89       
90    texname, elev_output = sww2timeseries(swwfiles,
91                                          project.gauges_dir_name,
92#                                          project.gauges_dir_name_simple,
93                                          production_dirs,
94                                          report = False,
95                                          #reportname = report_name,
96#                                          plot_quantity = ['stage', 'momentum'],
97                                          plot_quantity = ['stage', 'xmomentum', 'ymomentum'],
98                                          surface = False,
99                                          time_min = None,
100                                          time_max = None,
101                                          title_on = False,
102                                          verbose = True)
103                                         
Note: See TracBrowser for help on using the repository browser.