""" Generate images of "gauges" for production run Inputs: production dirs: dictionary of production directories with a association to that simulation run, eg high tide, low tide and MSL. Outputs: * figures used for report stored in the report_figure directory """ from os import getcwd, sep, altsep, mkdir, access, F_OK import project from anuga.abstract_2d_finite_volumes.util import sww2timeseries # bulli event production_dirs = {'20070703_061553_run_final_0_dampier_nbartzis': ''} # 20070703_053716_run_final_4.9_exmouth_nbartzis HAT exmouth # 20070703_053608_run_final_0_exmouth_nbartzis # MSL exmouth # 20070703_053822_run_final_4.9_onslow_nbartzis # HAT onslow # 20070703_061501_run_final_0_onslow_nbartzis # MSL onslow # 20070703_062312_run_final_4.9_dampier_nbartzis # HAT dampier # 20070703_061553_run_final_0_dampier_nbartzis # MSL dampier is_parallel = True if is_parallel is True: no_nodes = 4 if is_parallel is False: swwfiles = {} for label_id in production_dirs.keys(): file_loc = project.output_dir + label_id + sep swwfile = file_loc + project.scenario_name + '.sww' swwfiles[swwfile] = label_id texname, elev_output = sww2timeseries(swwfiles, project.beach_gauges, production_dirs, report = False, plot_quantity = ['stage', 'speed'], generate_fig = False, surface = False, time_min = None, time_max = None, time_unit = 'hours', title_on = False, use_cache = True, verbose = True) if is_parallel is True: for count in range(no_nodes): swwfiles = {} for label_id in production_dirs.keys(): file_loc = project.output_dir + label_id + sep extra = '_P%i_%i' %(count,no_nodes) swwfile = file_loc + project.scenario_name + extra + '.sww' swwfiles[swwfile] = label_id texname, elev_output = sww2timeseries(swwfiles, project.beach_gauges, production_dirs, report = False, plot_quantity = ['stage', 'speed'], generate_fig = False, surface = False, time_min = None, time_max = None, time_unit = 'hours', title_on = False, use_cache = True, verbose = True)