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 | # bulli event |
---|
20 | production_dirs = {'20070619_042043_run_final_1.4_onslow_nbartzis': ''} |
---|
21 | # 20070618_035101_run_final_1.4_dampier_nbartzis # HAT dampier |
---|
22 | # 20070618_035114_run_final_0_dampier_nbartzis # MSL dampier |
---|
23 | # 20070619_042542_run_final_1.4_exmouth_nbartzis # HAT exmouth parallel 4 |
---|
24 | # 20070619_042417_run_final_0_exmouth_nbartzis # MSL exmouth parallel 4 |
---|
25 | # 20070619_042043_run_final_1.4_onslow_nbartzis # HAT onslow |
---|
26 | # 20070619_042140_run_final_0_onslow_nbartzis # MSL onslow parallel 2 |
---|
27 | |
---|
28 | is_parallel = True |
---|
29 | |
---|
30 | if is_parallel is True: |
---|
31 | no_nodes = 4 |
---|
32 | |
---|
33 | if is_parallel is False: |
---|
34 | |
---|
35 | swwfiles = {} |
---|
36 | for label_id in production_dirs.keys(): |
---|
37 | |
---|
38 | file_loc = project.output_dir + label_id + sep |
---|
39 | swwfile = file_loc + project.scenario_name + '.sww' |
---|
40 | swwfiles[swwfile] = label_id |
---|
41 | |
---|
42 | texname, elev_output = sww2timeseries(swwfiles, |
---|
43 | project.beach_gauges, |
---|
44 | production_dirs, |
---|
45 | report = False, |
---|
46 | plot_quantity = ['stage', 'speed'], |
---|
47 | generate_fig = False, |
---|
48 | surface = False, |
---|
49 | time_min = None, |
---|
50 | time_max = None, |
---|
51 | time_unit = 'hours', |
---|
52 | title_on = False, |
---|
53 | use_cache = True, |
---|
54 | verbose = True) |
---|
55 | |
---|
56 | if is_parallel is True: |
---|
57 | |
---|
58 | for count in range(no_nodes): |
---|
59 | swwfiles = {} |
---|
60 | for label_id in production_dirs.keys(): |
---|
61 | |
---|
62 | file_loc = project.output_dir + label_id + sep |
---|
63 | extra = '_P%i_%i' %(count,no_nodes) |
---|
64 | swwfile = file_loc + project.scenario_name + extra + '.sww' |
---|
65 | swwfiles[swwfile] = label_id |
---|
66 | |
---|
67 | texname, elev_output = sww2timeseries(swwfiles, |
---|
68 | project.beach_gauges, |
---|
69 | production_dirs, |
---|
70 | report = False, |
---|
71 | plot_quantity = ['stage', 'speed'], |
---|
72 | generate_fig = False, |
---|
73 | surface = False, |
---|
74 | time_min = None, |
---|
75 | time_max = None, |
---|
76 | time_unit = 'hours', |
---|
77 | title_on = False, |
---|
78 | use_cache = True, |
---|
79 | verbose = True) |
---|
80 | |
---|