source: anuga_work/production/onslow_2006/MOST_timeseries.py @ 3569

Last change on this file since 3569 was 3514, checked in by duncan, 18 years ago

Hi all,
I'm doing a change in the anuga structure, moving the code to

\anuga_core\source\anuga

After you have done an svn update, the PYTHONPATH has to be changed to;
PYTHONPATH = anuga_core/source/

This is part of changes required to make installation of anuga quicker and reducing the size of our sandpits.

If any imports are broken, try fixing them. With adding anuga. to them for example. If this seems to have really broken things, email/phone me.

Cheers
Duncan

File size: 3.3 KB
Line 
1"""
2Generate latex output comparing time series of given sww files
3
4Inputs:
5
6production dirs: dictionary of output directories with a
7                 association to simulation, eg 50m boundary, 100m boundary
8
9gauge_map:       graphical output from make_gauges.py
10
11Outputs:
12
13* latex output to generate figures for report
14* figures used for report stored in the report_figure directory
15NOTE, this directory will need to be committed, as well as
16the latex files.
17
18June 2006                   
19"""
20
21from os import sep, getcwd, F_OK, access, mkdir
22import project
23from anuga.pyvolution.util import sww2timeseries, get_gauges_from_file
24
25# User defined inputs
26production_dirs = {'20060515_001733': '100m boundary',
27                   '20060530_102753': '50m boundary'}#,
28                   #'MOST': 'MOST'}
29
30gauge_map = 'boundarycomparison.png'
31
32# Create sections and graphs for each designated production directory
33latex_output = []
34swwfiles = {}
35for label_id in production_dirs.keys():
36   
37    file_loc = project.outputdir + label_id + sep
38    swwfile = file_loc + project.basename + '.sww'
39    if label_id == 'MOST':
40        swwfile = project.boundarydir + project.boundary_basename + '.sww'
41    swwfiles[swwfile] = label_id
42
43print 'swwfiles', swwfiles
44
45texname, vec = sww2timeseries(swwfiles,
46                              project.gauges50,#project.gauge_comparison,
47                              production_dirs,
48                              report = True,
49                              reportname = 'latexoutput_MOST_ANUGA_comparison',
50                              plot_quantity = ['stage', 'speed'],
51                              surface = False,
52                              time_min = None,
53                              time_max = None,
54                              title_on = False,
55                              verbose = True)
56
57latex_output.append(texname)
58
59from shutil import copy, move
60copy ('report' + sep + texname + '.tex', project.comparereportdir + sep + texname + '.tex')
61
62# Start report generation
63input_name = project.comparereportdir + sep + 'MOST_ANUGA_comparison_onslow.tex'
64fid = open(input_name, 'w')
65
66s = '\\begin{figure}[hbt] \n \centerline{ \includegraphics[width=150mm, height=100mm]{../report_figures/%s}}' %gauge_map
67fid.write(s)
68
69= """
70\caption{Point locations used to compare MOST and ANUGA for Onslow region.} 
71\label{fig:comparisonpoints}
72\end{figure}
73"""
74fid.write(s)
75   
76s = '\input{%s} \n \clearpage \n \n' %latex_output[0]
77fid.write(s)
78
79
80# Generate latex output for location points
81#s = '\\begin{table} \label{table:MOSTlocationsonslow} \n'
82#fid.write(s)
83#s = '\caption{Defined point locations for comparison study for Onslow region.}'
84#fid.write(s)
85#s = """
86#\\begin{center}
87#\\begin{tabular}{|l|l|l|l|}\hline
88#\\bf{Point Name} & \\bf{Easting} & \\bf{Northing} & \\bf{Elevation (m)}\\\\ \hline
89#"""
90#fid.write(s)
91
92#for i, thisvec in enumerate(vec):
93#    name = thisvec[0]
94#    east = thisvec[1]
95#    north = thisvec[2]
96#    elev = thisvec[3]
97#    s = '%s & %.2f & %.2f & %.2f \\\\ \hline \n' %(name, east, north, elev)
98#    fid.write(s)
99#    for which_one in plot_quantity:
100#        move ('report_figures' + sep + 'gauge'+name.replace(' ','')+which_one+'.png', project.comparereportfigdir)
101
102#s = '\\end{tabular} \n  \end{center} \n \end{table} \n \n'
103#fid.write(s)
Note: See TracBrowser for help on using the repository browser.