Ignore:
Timestamp:
May 30, 2006, 12:00:56 PM (18 years ago)
Author:
sexton
Message:

including references and more updates to report words

File:
1 edited

Legend:

Unmodified
Added
Removed
  • production/pt_hedland_2006/make_report.py

    r2950 r3015  
    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                   '': '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 = []
     
    7185                             label_id,
    7286                             report = True,
    73                              plot_quantity = ['stage', 'velocity', 'bearing'],
     87                             plot_quantity = ['stage', 'velocity'],
    7488                             time_min = None,
    7589                             time_max = None,
    76                              title_on = False,   
     90                             title_on = False,
    7791                             verbose = True)
    7892
     
    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{table} \label{table:gaugelocations} \n'
     175fid.write(s)
     176s = '\caption{Defined gauge locations for %s study area.}' %scenario_name.title()
     177fid.write(s)
     178s = """
     179\\begin{center}
     180\\begin{tabular}{|l|l|l|l|}\hline
     181\\bf{Gauge Name} & \\bf{Easting} & \\bf{Northing} & \\bf{Elevation}\\\\ \hline
     182"""
     183fid.write(s)
     184
     185gauges, locations = get_gauges_from_file(project.gauge_filename)
     186
     187for name, gauges in zip(locations, gauges):
     188    east = gauges[0]
     189    north = gauges[1]
     190    elev = 0.0
     191    #elev = gauges[2]
     192    s = '%s & %.2f & %.2f & %.2f \\\\ \hline \n' %(name.replace('_',' '), east, north, elev)
     193    fid.write(s)
     194
     195s = '\\end{tabular} \n  \end{center} \n \end{table} \n \n'
     196fid.write(s)
     197
     198s = '\input{interpretation} \n'
    156199fid.write(s)
    157200
     
    162205    s = '\subsection{%s} \n \n' %production_dirs[name]     
    163206    fid.write(s)
    164    
     207
     208    s = '\input{%s} \n \clearpage \n \n' %max_maps[production_dirs[name]]
     209    fid.write(s)
     210
    165211    s = '\input{%s} \n \clearpage \n \n' %latex_output[i]
    166212    fid.write(s)
    167213
    168 
    169 # Closing   
     214# Closing
     215
    170216s = """
    171217   \section{Damage modelling}
    172218     \input{damage}
    173 
    174     \section{Summary}
     219"""
     220fid.write(s)
     221
     222for i, name in enumerate(production_dirs.keys()):
     223
     224    s = '\subsection{%s} \n \n' %production_dirs[name]     
     225    fid.write(s)
     226
     227    s = '\input{%s} \n \clearpage \n \n' %damage_maps[production_dirs[name]]
     228    fid.write(s)
     229
     230
     231s = """
     232   \section{Summary}
    175233     \input{summary}
    176234     
    177235   \section{References}
    178 
     236    \input{references}
     237   
    179238   \section{Metadata}
    180239     \label{sec:metadata}
Note: See TracChangeset for help on using the changeset viewer.