Ignore:
Timestamp:
May 26, 2006, 2:26:21 PM (19 years ago)
Author:
sexton
Message:

updates to report

File:
1 edited

Legend:

Unmodified
Added
Removed
  • production/onslow_2006/make_report.py

    r2960 r2983  
    3434* an introduction must be written in introduction.tex; a basic outline and
    3535  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.
    3841* a summary must be written into summary.tex
    3942* metadata for the scenario data to be included in metadata.tex
     
    4447from os import getcwd, sep, altsep, mkdir, access, F_OK
    4548import project
    46 from pyvolution.util import sww2timeseries
     49from pyvolution.util import sww2timeseries, get_gauges_from_file
    4750
    4851# Derive scenario name
     
    5457    scenario_name = '%s %s' %(test[0], test[1])
    5558
     59# Create report directory
     60reportdir = getcwd()+sep+'report'+sep
     61if access(reportdir,F_OK) == 0:
     62    mkdir (reportdir)
     63   
    5664# User defined inputs
    5765report_title = 'Tsunami impact modelling for the North West shelf: %s' %scenario_name.title()
     
    6068                   '20060426_004237': 'Lowest Astronomical Tide'}
    6169
     70max_maps = {'Highest Astronomical Tide': 'HAT_map',
     71            'Lowest Astronomical Tide': 'LAT_map'}
     72
     73damage_maps = {'Highest Astronomical Tide': 'HAT_damage',
     74               'Lowest Astronomical Tide': 'LAT_damage'}
     75 
    6276# Create sections and graphs for each designated production directory
    6377latex_output = []
     
    8094
    8195
     96
    8297# Start report generation
    83 reportdir = getcwd()+sep+'report'+sep
    84 if access(reportdir,F_OK) == 0:
    85     mkdir (reportdir)
    8698report_name = reportdir + scenario + '_report.tex'
    8799fid = open(report_name, 'w')
     
    94106% * an introduction must be written in introduction.tex; a basic outline and
    95107%   some of the core inputs are already in place
    96 % * an results.tex file needs to be written for the particular scenario
    97108% * 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.
    98113% * a summary must be written into summary.tex
    99114% * metadata for the scenario data to be included in metadata.tex
     
    151166  \section{Inundation modelling results}
    152167     \label{sec:results}
    153      \input{results}
     168     \input{computational_setup}
    154169     
    155170"""
     171fid.write(s)
     172
     173# Generate latex output for gauges
     174s = '\\begin{center} \n \\begin{tabular}{|l|l|l|}\hline \n \\bf{Gauge Name} & \\bf{Easting} & \\bf{Northing} \\\\ \hline \n'
     175fid.write(s)
     176
     177gauges, locations = get_gauges_from_file(project.gauge_filename)
     178
     179for 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
     185s = '\\end{tabular} \n \\end{center} \n \n'
     186fid.write(s)
     187
     188s = '\input{interpretation} \n'
    156189fid.write(s)
    157190
     
    162195    s = '\subsection{%s} \n \n' %production_dirs[name]     
    163196    fid.write(s)
    164    
     197
     198    s = '\input{%s} \n \clearpage \n \n' %max_maps[production_dirs[name]]
     199    fid.write(s)
     200
    165201    s = '\input{%s} \n \clearpage \n \n' %latex_output[i]
    166202    fid.write(s)
    167 
    168203
    169204# Closing
     
    172207   \section{Damage modelling}
    173208     \input{damage}
    174      
     209"""
     210fid.write(s)
     211
     212for 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
     221s = """
    175222   \section{Summary}
    176223     \input{summary}
Note: See TracChangeset for help on using the changeset viewer.