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