Changeset 3094


Ignore:
Timestamp:
Jun 6, 2006, 12:01:52 PM (18 years ago)
Author:
sexton
Message:

fix legend and add elevation information to caption in sww2timeseries

Files:
1 deleted
34 edited

Legend:

Unmodified
Added
Removed
  • inundation/pyvolution/util.py

    r3083 r3094  
    544544def sww2timeseries(swwfiles,
    545545                   gauge_filename,
    546                    #label_id,
    547546                   production_dirs,
    548547                   report = None,
     
    566565                    - assume that all conserved quantities have been stored
    567566                    - assume each sww file has been simulated with same timestep
    568                    
     567   
    569568    gauge_filename  - name of file containing gauge data
    570569                        - name, easting, northing
     
    625624    k = _sww2timeseries(swwfiles,
    626625                        gauge_filename,
    627                         #label_id,
    628626                        production_dirs,
    629627                        report,
     
    638636def _sww2timeseries(swwfiles,
    639637                    gauge_filename,
    640                     #label_id,
    641638                    production_dirs,
    642639                    report = None,
     
    646643                    title_on = None,
    647644                    verbose = False):   
    648 
    649     #assert type(swwfile) == type(''),\
    650     #           'The sww filename must be a string'
    651 
    652     #try:
    653     #    fid = open(swwfile)
    654     #except Exception, e:
    655     #    msg = 'File "%s" could not be opened: Error="%s"'\
    656     #              %(swwfile, e)
    657     #    raise msg
    658 
    659     #index = swwfile.rfind(sep)
    660     #file_loc = swwfile[:index+1]
    661645       
    662646    assert type(gauge_filename) == type(''),\
     
    683667    if title_on is None:
    684668        title_on = True
    685      
    686     #assert type(label_id) == type(''),\
    687     #           'label_id to sww2timeseries must be a string'
    688669   
    689670    if verbose: print '\n Gauges obtained from: %s \n' %gauge_filename
     
    695676    f_list = []
    696677    label_id = []
     678    leg_label = []
     679    themaxT = 0.0
     680    theminT = 0.0
    697681   
    698682    for swwfile in swwfiles.keys():
     
    710694                          verbose = True,
    711695                          use_cache = True)
    712        
    713         #if max(f.quantities['xmomentum']) > 1.e10:
    714         #    msg = 'Not all conserved quantities available from sww file. \n sww2timeseries requires all conserved quantities stored in sww file'
    715         #    raise Exception, msg
    716696   
    717697        index = swwfile.rfind(sep)
    718698        file_loc.append(swwfile[:index+1])
    719699        label_id.append(swwfiles[swwfile])
     700        leg_label.append(production_dirs[swwfiles[swwfile]])
     701       
    720702        f_list.append(f)
    721        
    722     #T.append(f.get_time())
    723     T = f.get_time()
    724        
     703        maxT = max(f.get_time())
     704        minT = min(f.get_time())
     705        if maxT > themaxT: themaxT = maxT
     706        if minT > theminT: theminT = minT
     707
    725708    if time_min is None:
    726         time_min = min(T)
     709        time_min = theminT # min(T)
    727710    else:
    728         if time_min < min(T):
     711        if time_min < theminT: # min(T):
    729712            msg = 'Minimum time entered not correct - please try again'
    730713            raise Exception, msg
    731714
    732715    if time_max is None:
    733         time_max = max(T)
     716        time_max = themaxT # max(T)
    734717    else:
    735         if time_max > max(T):
     718        if time_max > themaxT: # max(T):
    736719            msg = 'Maximum time entered not correct - please try again'
    737720            raise Exception, msg
     
    739722    if verbose: print 'Inputs OK - going to generate figures'
    740723
    741     return generate_figures(plot_quantity, file_loc, report,
    742                             f_list, gauges, locations, production_dirs,
     724    return generate_figures(plot_quantity, file_loc, report, leg_label,
     725                            f_list, gauges, locations, elev, production_dirs,
    743726                            time_min, time_max, title_on, label_id, verbose)
    744727                         
     
    801784    return bearing
    802785
    803 def generate_figures(plot_quantity, file_loc, report, f_list, gauges,
    804                      locations, production_dirs, time_min, time_max,
     786def generate_figures(plot_quantity, file_loc, report, leg_label, f_list, gauges,
     787                     locations, elev, production_dirs, time_min, time_max,
    805788                     title_on, label_id, verbose):
    806789
     
    810793    from pylab import ion, hold, plot, axis, figure, legend, savefig, \
    811794         xlabel, ylabel, title, close, subplot
    812 
    813     #filename = file_loc.split(sep)
    814795
    815796    if report == True:   
     
    831812            if verbose: print '\n Latex output printed to %s \n' %texfilename
    832813            fid = open(texfilename, 'w')
    833             leg_label = []
    834             for label_id in production_dirs.keys():
    835                 leg_label.append(production_dirs[label_id])
    836814    else:
    837815        texfile = ''
     
    10361014                   
    10371015                word_quantity += ' and ' + plot_quantity[nn-1]               
    1038                 caption = 'Time series for %s at %s gauge location' %(word_quantity, locations[k]) #gaugeloc.replace('_',' '))
     1016                caption = 'Time series for %s at %s gauge location (elevation %.2fm)' %(word_quantity, locations[k], elev[k]) #gaugeloc.replace('_',' '))
    10391017                label = '%sgauge%s' %(label_id2, gaugeloc2)
    10401018                s = '\end{tabular} \n \\caption{%s} \n \label{fig:%s} \n \end{figure} \n \n' %(caption, label)
     
    10551033                for which_quantity in plot_quantity:
    10561034                    where1 += 1
    1057                     #index = j*len(plot_quantity)*k
    10581035                    s = '\includegraphics[width=0.49\linewidth, height=50mm]{%s%s}' %(graphname_report[index], '.png')
    10591036                    index += 1
     
    10671044            word_quantity += ' and ' + plot_quantity[nn-1]           
    10681045            label = 'gauge%s' %(gaugeloc2)
    1069             caption = 'Time series for %s at %s gauge location' %(word_quantity, locations[k]) #gaugeloc.replace('_',' '))
     1046            caption = 'Time series for %s at %s gauge location (elevation %.2fm)' %(word_quantity, locations[k], elev[k])
    10701047           
    1071             #s = '\\caption{%s} \n \label{fig:%s} \n \end{figure} \n \n' %(caption, label)
    10721048            s = '\end{tabular} \n \\caption{%s} \n \label{fig:%s} \n \end{figure} \n \n' %(caption, label)
    10731049            fid.write(s)
    10741050            c += 1
    1075             if c % 25 == 0: fid.write('\\clearpage \n')
    1076                
     1051            if c % 25 == 0: fid.write('\\clearpage \n')         
    10771052           
    10781053            #### finished generating figures ###
  • production/onslow_2006/make_report.py

    r3082 r3094  
    9393texname = sww2timeseries(swwfiles,
    9494                         project.gauge_filename,
    95                          #label_id,
    9695                         production_dirs,
    9796                         report = True,
     
    168167   
    169168  \section{Tsunami scenarios}
    170     \label{sec:tsunamiscenarios}
     169    \label{sec:tsunamiscenario}
    171170    \input{tsunami_scenario}
    172171
  • production/onslow_2006/report/latexoutput.tex

    r3077 r3094  
    55\includegraphics[width=0.49\linewidth, height=50mm]{../report_figures/gaugeBeadonPointLoadingBerthspeed.png}\\
    66\end{tabular}
    7  \caption{Time series for stage and speed at Beadon Point Loading Berth gauge location}
     7 \caption{Time series for stage and speed at Beadon Point Loading Berth gauge location (elevation -8.69m)}
    88 \label{fig:gaugeBeadonPointLoadingBerth}
    99 \end{figure}
     
    1515\includegraphics[width=0.49\linewidth, height=50mm]{../report_figures/gaugeHospitalspeed.png}\\
    1616\end{tabular}
    17  \caption{Time series for stage and speed at Hospital gauge location}
     17 \caption{Time series for stage and speed at Hospital gauge location (elevation 7.56m)}
    1818 \label{fig:gaugeHospital}
    1919 \end{figure}
     
    2525\includegraphics[width=0.49\linewidth, height=50mm]{../report_figures/gaugeBindiBindiCommunityspeed.png}\\
    2626\end{tabular}
    27  \caption{Time series for stage and speed at Bindi Bindi Community gauge location}
     27 \caption{Time series for stage and speed at Bindi Bindi Community gauge location (elevation 1.00m)}
    2828 \label{fig:gaugeBindiBindiCommunity}
    2929 \end{figure}
     
    3535\includegraphics[width=0.49\linewidth, height=50mm]{../report_figures/gaugePowerStationspeed.png}\\
    3636\end{tabular}
    37  \caption{Time series for stage and speed at Power Station gauge location}
     37 \caption{Time series for stage and speed at Power Station gauge location (elevation 5.17m)}
    3838 \label{fig:gaugePowerStation}
    3939 \end{figure}
     
    4545\includegraphics[width=0.49\linewidth, height=50mm]{../report_figures/gaugeAirportRunwayspeed.png}\\
    4646\end{tabular}
    47  \caption{Time series for stage and speed at Airport Runway gauge location}
     47 \caption{Time series for stage and speed at Airport Runway gauge location (elevation 3.00m)}
    4848 \label{fig:gaugeAirportRunway}
    4949 \end{figure}
     
    5555\includegraphics[width=0.49\linewidth, height=50mm]{../report_figures/gaugeBeadonCreekDocksspeed.png}\\
    5656\end{tabular}
    57  \caption{Time series for stage and speed at Beadon Creek Docks gauge location}
     57 \caption{Time series for stage and speed at Beadon Creek Docks gauge location (elevation 1.76m)}
    5858 \label{fig:gaugeBeadonCreekDocks}
    5959 \end{figure}
     
    6565\includegraphics[width=0.49\linewidth, height=50mm]{../report_figures/gaugeWestofGroynespeed.png}\\
    6666\end{tabular}
    67  \caption{Time series for stage and speed at West of Groyne gauge location}
     67 \caption{Time series for stage and speed at West of Groyne gauge location (elevation -2.10m)}
    6868 \label{fig:gaugeWestofGroyne}
    6969 \end{figure}
     
    7575\includegraphics[width=0.49\linewidth, height=50mm]{../report_figures/gaugeBeadonCreekmouthspeed.png}\\
    7676\end{tabular}
    77  \caption{Time series for stage and speed at Beadon Creek mouth gauge location}
     77 \caption{Time series for stage and speed at Beadon Creek mouth gauge location (elevation -2.80m)}
    7878 \label{fig:gaugeBeadonCreekmouth}
    7979 \end{figure}
     
    8585\includegraphics[width=0.49\linewidth, height=50mm]{../report_figures/gaugeBeadonCreeksouthofdockspeed.png}\\
    8686\end{tabular}
    87  \caption{Time series for stage and speed at Beadon Creek south of dock gauge location}
     87 \caption{Time series for stage and speed at Beadon Creek south of dock gauge location (elevation -1.49m)}
    8888 \label{fig:gaugeBeadonCreeksouthofdock}
    8989 \end{figure}
     
    9595\includegraphics[width=0.49\linewidth, height=50mm]{../report_figures/gaugeCentredamwallspeed.png}\\
    9696\end{tabular}
    97  \caption{Time series for stage and speed at Centre dam wall gauge location}
     97 \caption{Time series for stage and speed at Centre dam wall gauge location (elevation 3.00m)}
    9898 \label{fig:gaugeCentredamwall}
    9999 \end{figure}
     
    105105\includegraphics[width=0.49\linewidth, height=50mm]{../report_figures/gaugeDamoverflowspeed.png}\\
    106106\end{tabular}
    107  \caption{Time series for stage and speed at Dam overflow gauge location}
     107 \caption{Time series for stage and speed at Dam overflow gauge location (elevation 1.53m)}
    108108 \label{fig:gaugeDamoverflow}
    109109 \end{figure}
     
    115115\includegraphics[width=0.49\linewidth, height=50mm]{../report_figures/gaugeLightTowerspeed.png}\\
    116116\end{tabular}
    117  \caption{Time series for stage and speed at Light Tower gauge location}
     117 \caption{Time series for stage and speed at Light Tower gauge location (elevation 1.47m)}
    118118 \label{fig:gaugeLightTower}
    119119 \end{figure}
     
    125125\includegraphics[width=0.49\linewidth, height=50mm]{../report_figures/gaugeBeadonBaywestspeed.png}\\
    126126\end{tabular}
    127  \caption{Time series for stage and speed at Beadon Bay west gauge location}
     127 \caption{Time series for stage and speed at Beadon Bay west gauge location (elevation -4.61m)}
    128128 \label{fig:gaugeBeadonBaywest}
    129129 \end{figure}
     
    135135\includegraphics[width=0.49\linewidth, height=50mm]{../report_figures/gaugeBeadonBayeastspeed.png}\\
    136136\end{tabular}
    137  \caption{Time series for stage and speed at Beadon Bay east gauge location}
     137 \caption{Time series for stage and speed at Beadon Bay east gauge location (elevation -3.56m)}
    138138 \label{fig:gaugeBeadonBayeast}
    139139 \end{figure}
  • production/onslow_2006/report/onslow_2006_report.tex

    r3082 r3094  
    5252   
    5353  \section{Tsunami scenarios}
    54     \label{sec:tsunamiscenarios}
     54    \label{sec:tsunamiscenario}
    5555    \input{tsunami_scenario}
    5656
  • production/pt_hedland_2006/make_report.py

    r3082 r3094  
    168168   
    169169  \section{Tsunami scenarios}
    170     \label{sec:tsunamiscenarios}
     170    \label{sec:tsunamiscenario}
    171171    \input{tsunami_scenario}
    172172
  • production/pt_hedland_2006/project.py

    r3082 r3094  
    108108# region to export (used from export_results.py)
    109109
    110 e_min_area = 633000
    111 e_max_area = 690000
    112 n_min_area = 7740000
    113 n_max_area = 7761000
     110e_min_area = 659000#633000
     111e_max_area = 678000#690000
     112n_min_area = 7746000#7740000
     113n_max_area = 7757000#7761000
    114114
    115115refzone = 50 # confirm with Hamish
Note: See TracChangeset for help on using the changeset viewer.