Changeset 3188


Ignore:
Timestamp:
Jun 20, 2006, 5:59:42 PM (19 years ago)
Author:
sexton
Message:

make gauges to compare MOST and ANUGA time series

Location:
production/onslow_2006
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • production/onslow_2006/MOST_timeseries.py

    r3159 r3188  
    44Inputs:
    55
    6 output dirs: dictionary of output directories with a
    7              association to simulation, eg 50m boundary, 100m boundary
    8                    
     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
    911Outputs:
    1012
     
    2224
    2325# User defined inputs
    24 production_dirs = {'SU-AU_clip': 'MOST'}
     26production_dirs = {'20060515_001733': '100m boundary',
     27                   #'20060530_102753': '50m boundary'}#,
     28                   'MOST': 'MOST'}
    2529
    2630gauge_map = 'boundarycomparison.png'
    27 plot_quantity = ['stage', 'speed']
    2831
    2932# Create sections and graphs for each designated production directory
     
    3235for label_id in production_dirs.keys():
    3336   
    34     file_loc = project.boundarydir
    35     swwfile = file_loc + project.boundary_basename + '.sww'
     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'
    3641    swwfiles[swwfile] = label_id
     42
     43print 'swwfiles', swwfiles
    3744
    3845texname, vec = sww2timeseries(swwfiles,
     
    4047                              production_dirs,
    4148                              report = True,
    42                               reportname = 'latexoutput_MOST_input',
    43                               plot_quantity = plot_quantity,
     49                              reportname = 'latexoutput_MOST_ANUGA_comparison',
     50                              plot_quantity = ['stage', 'speed'],
     51                              surface = False,
    4452                              time_min = None,
    4553                              time_max = None,
     
    4957latex_output.append(texname)
    5058
     59from shutil import copy, move
     60copy ('report' + sep + texname + '.tex', project.comparereportdir + sep + texname + '.tex')
    5161
    5262# Start report generation
    53 reportdir = getcwd()+sep+'report'+sep
    54 if access(reportdir,F_OK) == 0:
    55     mkdir (reportdir)
    56 input_name = reportdir + sep + 'MOST_input_onslow.tex'
     63input_name = project.comparereportdir + sep + 'comparison_onslow.tex'
    5764fid = 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
     69s  = """
     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
    5879
    5980# Generate latex output for location points
     
    81102#s = '\\end{tabular} \n  \end{center} \n \end{table} \n \n'
    82103#fid.write(s)
    83 
    84 s = '\\begin{figure}[hbt] \n \centerline{ \includegraphics[width=150mm, height=100mm]{../report_figures/%s}}' %gauge_map
    85 fid.write(s)
    86 
    87 s  = """
    88 \caption{Point locations used for MOST input for Onslow region.} 
    89 \label{fig:boundarypoints}
    90 \end{figure}
    91 """
    92 fid.write(s)
    93    
    94 s = '\input{%s} \n \clearpage \n \n' %latex_output[0]
    95 fid.write(s)
  • production/onslow_2006/compare_timeseries.py

    r3150 r3188  
    4343                              report = True,
    4444                              reportname = 'latexoutput_compare',
     45                              surface = False,
    4546                              plot_quantity = plot_quantity,
    4647                              time_min = None,
  • production/onslow_2006/make_gauges.py

    r3169 r3188  
    1 """ Make a line of gauges from outside boundary to near centre polygon
     1""" Make a line of gauges from near the boundary to near centre polygon
    22for Onslow study to look at MOST wave and compare to ANUGA output
     3Output from here is used as the gauge file input in MOST_timeseries.py
    34"""
    45import project
    56from pylab import plot, xlabel, ylabel, title, ion, axis, savefig, close, text
    6 from utilities.polygon import poly_xy
     7from utilities.polygon import poly_xy, is_inside_polygon
    78from Numeric import arange
    89from pmesh.create_mesh import convert_points_from_latlon_to_utm
     
    3334
    3435MOSTymax = MOSTymax-3000.0
    35 print 'MOST clipping: ', MOSTxmin, MOSTxmax, MOSTymin, MOSTymax
    3636# nominated point in centre region for Onslow
    3737x2 = 305000.0
     
    6464        for j, xpoint in enumerate(plotx):
    6565            ypoint = m*xpoint+c
    66             if ypoint > testy and ypoint <= d0[1]:
    67             #if ypoint >= testy and ypoint <= MOSTymax:
    68                 if xpoint > MOSTxmin and xpoint < MOSTxmax:
     66            test = is_inside_polygon([xpoint,ypoint],project.polyAll,closed=True)
     67            if test == True:
     68                if ypoint > testy and ypoint < MOSTymax:
    6969                    xplot.append(xpoint)
    7070                    yplot.append(ypoint)
     
    7878        for j, xpoint in enumerate(plotx):
    7979            ypoint = m*xpoint+c
    80             if ypoint > testy and ypoint < MOSTymax: #testy
    81                 if xpoint > MOSTxmin and xpoint < MOSTxmax:
     80            test = is_inside_polygon([xpoint,ypoint],project.polyAll,closed=True)
     81            if test == True:
     82                if ypoint > testy and ypoint < MOSTymax:
    8283                    xplot.append(xpoint)
    8384                    yplot.append(ypoint)
  • production/onslow_2006/make_report.py

    r3181 r3188  
    9292    swwfiles[swwfile] = label_id
    9393
    94 texname, elev_output, = sww2timeseries(swwfiles,
    95                                        project.gauge_filename,
    96                                        production_dirs,
    97                                        report = True,
    98                                        reportname = 'latexoutput',
    99                                        plot_quantity = ['stage', 'speed'],
    100                                        time_min = None,
    101                                        time_max = None,
    102                                        title_on = False,
    103                                        verbose = True)
     94texname, elev_output = sww2timeseries(swwfiles,
     95                                      project.gauge_filename,
     96                                      production_dirs,
     97                                      report = True,
     98                                      reportname = 'latexoutput',
     99                                      plot_quantity = ['stage', 'speed'],
     100                                      surface = False,
     101                                      time_min = None,
     102                                      time_max = None,
     103                                      title_on = False,
     104                                      verbose = True)
    104105
    105106latex_output.append(texname)
  • production/onslow_2006/project.py

    r3158 r3188  
    6161gauges50 = gaugedir + '50_gauges.xya'
    6262gauge_comparison = gaugedir + 'MOST_comparison_gauges.xya'
     63gauge_comparison_3d = gaugedir + 'MOST_comparison_gauges_3d.xya'
    6364community_filename = gaugedir + 'CHINS_v2.csv'
    6465community_scenario = gaugedir + 'community_onslow.csv'
  • production/onslow_2006/report/data.tex

    r3169 r3188  
    1818(about 30 metres), produced from 1:50 000 contours, elevations and
    1919drainage. In addition, the Department of Land Information (DLI) has provided a
    20 20m DEM and orthophotography covering the NW Shelf. However, the 30m
     2020m Digital Elevation Model (DEM) and orthophotography
     21covering the NW Shelf. However, the 30m
    2122DTED Level 2 data is ``bare earth'' whereas the DLI data is distorted by
    2223vegetation
    2324and buildings so we have chosen to use the DTED as the onshore
    24 topographic data set.
     25topographic data set. It is also important to note that the DEM does
     26not include features such as rock walls, berths etc.
    2527
    2628With respect to the offshore data, the Department of Planning and
Note: See TracChangeset for help on using the changeset viewer.