Changeset 2983 for production/onslow_2006/make_report.py
- Timestamp:
- May 26, 2006, 2:26:21 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
production/onslow_2006/make_report.py
r2960 r2983 34 34 * an introduction must be written in introduction.tex; a basic outline and 35 35 some of the core inputs are already in place 36 * an results.tex file needs to be written for the particular scenario 37 * the tsunami-genic event should be discussed in tsunami_scenario.tex 36 * the tsunami-genic event should be discussed in tsunami_scenario.tex 37 * a computational_setup.tex file needs to be written for the particular scenario 38 * the interpretation of the results needs to be written to interpretation.tex 39 * maximum inundation maps need to be included in HAT_map and LAT_map etc. 40 * damage modelling maps need to be included in HAT_damage and LAT_damage etc. 38 41 * a summary must be written into summary.tex 39 42 * metadata for the scenario data to be included in metadata.tex … … 44 47 from os import getcwd, sep, altsep, mkdir, access, F_OK 45 48 import project 46 from pyvolution.util import sww2timeseries 49 from pyvolution.util import sww2timeseries, get_gauges_from_file 47 50 48 51 # Derive scenario name … … 54 57 scenario_name = '%s %s' %(test[0], test[1]) 55 58 59 # Create report directory 60 reportdir = getcwd()+sep+'report'+sep 61 if access(reportdir,F_OK) == 0: 62 mkdir (reportdir) 63 56 64 # User defined inputs 57 65 report_title = 'Tsunami impact modelling for the North West shelf: %s' %scenario_name.title() … … 60 68 '20060426_004237': 'Lowest Astronomical Tide'} 61 69 70 max_maps = {'Highest Astronomical Tide': 'HAT_map', 71 'Lowest Astronomical Tide': 'LAT_map'} 72 73 damage_maps = {'Highest Astronomical Tide': 'HAT_damage', 74 'Lowest Astronomical Tide': 'LAT_damage'} 75 62 76 # Create sections and graphs for each designated production directory 63 77 latex_output = [] … … 80 94 81 95 96 82 97 # Start report generation 83 reportdir = getcwd()+sep+'report'+sep84 if access(reportdir,F_OK) == 0:85 mkdir (reportdir)86 98 report_name = reportdir + scenario + '_report.tex' 87 99 fid = open(report_name, 'w') … … 94 106 % * an introduction must be written in introduction.tex; a basic outline and 95 107 % some of the core inputs are already in place 96 % * an results.tex file needs to be written for the particular scenario97 108 % * the tsunami-genic event should be discussed in tsunami_scenario.tex 109 % * an computational_setup.tex file needs to be written for the particular scenario 110 % * the interpretation of the results needs to be written to interpretation.tex 111 % * maximum inundation maps need to be included in HAT_map.tex and LAT_map.tex etc. 112 % * damage modelling maps need to be included in HAT_damage and LAT_damage etc. 98 113 % * a summary must be written into summary.tex 99 114 % * metadata for the scenario data to be included in metadata.tex … … 151 166 \section{Inundation modelling results} 152 167 \label{sec:results} 153 \input{ results}168 \input{computational_setup} 154 169 155 170 """ 171 fid.write(s) 172 173 # Generate latex output for gauges 174 s = '\\begin{center} \n \\begin{tabular}{|l|l|l|}\hline \n \\bf{Gauge Name} & \\bf{Easting} & \\bf{Northing} \\\\ \hline \n' 175 fid.write(s) 176 177 gauges, locations = get_gauges_from_file(project.gauge_filename) 178 179 for name, gauges in zip(locations, gauges): 180 east = gauges[0] 181 north = gauges[1] 182 s = '%s & %.2f & %.2f \\\\ \hline \n' %(name.replace('_',' '), east, north) 183 fid.write(s) 184 185 s = '\\end{tabular} \n \\end{center} \n \n' 186 fid.write(s) 187 188 s = '\input{interpretation} \n' 156 189 fid.write(s) 157 190 … … 162 195 s = '\subsection{%s} \n \n' %production_dirs[name] 163 196 fid.write(s) 164 197 198 s = '\input{%s} \n \clearpage \n \n' %max_maps[production_dirs[name]] 199 fid.write(s) 200 165 201 s = '\input{%s} \n \clearpage \n \n' %latex_output[i] 166 202 fid.write(s) 167 168 203 169 204 # Closing … … 172 207 \section{Damage modelling} 173 208 \input{damage} 174 209 """ 210 fid.write(s) 211 212 for i, name in enumerate(production_dirs.keys()): 213 214 s = '\subsection{%s} \n \n' %production_dirs[name] 215 fid.write(s) 216 217 s = '\input{%s} \n \clearpage \n \n' %damage_maps[production_dirs[name]] 218 fid.write(s) 219 220 221 s = """ 175 222 \section{Summary} 176 223 \input{summary}
Note: See TracChangeset
for help on using the changeset viewer.