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

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

update dampier

File size: 4.0 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   
43    for i in range(nodes):
44        print 'Sending node %d of %d' %(i,nodes)
45        swwfiles = {}
46        #reportname = report_name + '_%s' %(i)
47        for label_id in production_dirs.keys():
48            if label_id == 'boundaries':
49#                file_loc = project.boundaries_in_dir
50                swwfile = best_boundary_sww
51                print 'hi'
52            else:
53                file_loc = project.output_dir + label_id + sep
54                sww_extra = '_P%s_%s' %(i,nodes)
55                swwfile = file_loc + project.scenario_name + sww_extra + '.sww'
56                print 'swwfile',swwfile
57            swwfiles[swwfile] = label_id
58
59        texname, elev_output = sww2timeseries(swwfiles,
60                                              project.gauges_dir_name_simple,
61                                              production_dirs,
62                                              report = False,
63                                              #reportname = reportname,
64                                              plot_quantity = ['stage', 'momentum'],
65                                              generate_fig = False,
66                                              surface = False,
67                                              time_min = None,
68                                              time_max = None,
69                                              title_on = False,
70                                              verbose = True)
71           
72            #latex_output.append(texname)
73   
74
75else:
76   
77    for label_id in production_dirs.keys():
78       
79        if label_id == 'boundaries':
80                print 'boundaries'
81                file_loc = project.boundaries_in_dir
82                swwfile = project.boundaries_dir_name3 + '.sww'
83#                swwfile = boundary_dir_filename
84        else:
85            file_loc = project.output_dir + label_id + sep
86            swwfile = file_loc + project.scenario_name + '.sww'
87        swwfiles[swwfile] = label_id
88       
89    texname, elev_output = sww2timeseries(swwfiles,
90                                          project.gauges_dir_name,
91#                                          project.gauges_dir_name_simple,
92                                          production_dirs,
93                                          report = False,
94                                          #reportname = report_name,
95#                                          plot_quantity = ['stage', 'momentum'],
96                                          plot_quantity = ['stage', 'xmomentum', 'ymomentum'],
97                                          surface = False,
98                                          time_min = None,
99                                          time_max = None,
100                                          title_on = False,
101                                          verbose = True)
102                                         
Note: See TracBrowser for help on using the repository browser.