1 | """ |
---|
2 | Generate images of "gauges" for production run |
---|
3 | |
---|
4 | Inputs: |
---|
5 | |
---|
6 | production dirs: dictionary of production directories with a |
---|
7 | association to that simulation run, eg high tide, |
---|
8 | low tide and MSL. |
---|
9 | |
---|
10 | Outputs: |
---|
11 | |
---|
12 | * figures used for report stored in the report_figure directory |
---|
13 | |
---|
14 | """ |
---|
15 | from os import getcwd, sep, altsep, mkdir, access, F_OK |
---|
16 | import project |
---|
17 | from anuga.abstract_2d_finite_volumes.util import sww2timeseries |
---|
18 | |
---|
19 | # Create report directory |
---|
20 | reportdir = getcwd()+sep+'report'+sep |
---|
21 | if access(reportdir,F_OK) == 0: |
---|
22 | mkdir (reportdir) |
---|
23 | |
---|
24 | # sww file created from URS boundary |
---|
25 | production_dirs = {'boundaries': '10000 yr wave height' |
---|
26 | #'20070307_224017_run': 'URS boundary normal' |
---|
27 | } |
---|
28 | |
---|
29 | |
---|
30 | is_parallel = False |
---|
31 | if is_parallel == True: |
---|
32 | nodes = 2 |
---|
33 | |
---|
34 | # Generate figures |
---|
35 | swwfiles = {} |
---|
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 = |
---|
41 | if is_parallel == True: |
---|
42 | print 'buggur' |
---|
43 | |
---|
44 | |
---|
45 | else: |
---|
46 | |
---|
47 | for label_id in production_dirs.keys(): |
---|
48 | |
---|
49 | if label_id == 'boundaries': |
---|
50 | print 'boundaries' |
---|
51 | file_loc = project.boundaries_in_dir |
---|
52 | swwfile = project.boundaries_dir_name3 + '.sww' |
---|
53 | # swwfile = boundary_dir_filename |
---|
54 | else: |
---|
55 | file_loc = project.output_dir + label_id + sep |
---|
56 | swwfile = file_loc + project.scenario_name + '.sww' |
---|
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 = report_name, |
---|
64 | # plot_quantity = ['stage', 'momentum'], |
---|
65 | plot_quantity = ['stage', 'xmomentum', 'ymomentum'], |
---|
66 | surface = False, |
---|
67 | time_min = None, |
---|
68 | time_max = None, |
---|
69 | title_on = False, |
---|
70 | verbose = True) |
---|
71 | |
---|