Ignore:
Timestamp:
Jun 27, 2008, 3:10:16 PM (16 years ago)
Author:
duncan
Message:

Current Hinwood scenario

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/development/Hinwood_2008/slope.py

    r5426 r5447  
    88
    99from Numeric import arange, array, zeros, Float
    10 from pylab import meshgrid, cm, contourf, contour, ion, plot, xlabel, \
    11      ylabel, close, legend, savefig, title, figure ,colorbar, show #, cbar
    1210
    1311from anuga.fit_interpolate.interpolate import interpolate_sww2csv
     
    6462    return times, slope_locations, slopes
    6563
    66 def graph_slopes(slope_file):
     64def graph_slopes(slope_file, break_xs=None, break_times=None):
     65    from pylab import meshgrid, cm, contourf, contour, ion, plot, xlabel, \
     66         ylabel, close, legend, savefig, title, figure ,colorbar, show , axis
    6767    origin = 'lower'
    6868    times, slope_locations, slopes = load_slopes(slope_file)
    69     X, Y = meshgrid(times, slope_locations)
    70     #print "X", times
    71     #print "Y", slope_locations
     69    #print "times", times
     70    #print "slope_locations", slope_locations
    7271    #print "slopes", slopes
     72
     73    # Can't seem to reshape this info once it is in the function
    7374    CS = contourf(slope_locations, times, slopes, 10, # [-1, -0.1, 0, 0.1],
    74                         #alpha=0.5,
    75                         cmap=cm.bone,
    76                         origin=origin)
     75                  #alpha=0.5,
     76                  cmap=cm.bone,
     77                  origin=origin)
    7778   
    7879    #CS2 = contour(slope_locations, times, slopes, CS.levels[::2],
     
    8485    xlabel('x location')
    8586    ylabel('Time, seconds')
     87    axis([5.0, 5.5, 30, 60])
    8688
     89
     90    if break_times is not None and break_xs is not None:
     91        plot(break_xs, break_times, 'ro')
     92   
    8793    # Make a colorbar for the ContourSet returned by the contourf call.
    8894    cbar = colorbar(CS)
    89     cbar.ax.set_ylabel('verbosity coefficient')
     95    cbar.ax.set_ylabel('slope')
    9096    # Add the contour line levels to the colorbar
    9197    #cbar.add_lines(CS2)
     
    105111                                       outputdir_name=outputdir_name)
    106112        end = id + ".csv"
    107         slope_file = pro_instance.outputdir + "slope_depth_" + end
    108         graph_slopes(slope_file)
     113        slope_file = pro_instance.outputdir + "d3slope_stage_" + end
     114        graph_slopes(slope_file, run_data['break_xs'],
     115                     run_data['break_times'])
    109116   
    110117def gauges_for_slope():
     118    from scenarios import scenarios
    111119    from scenarios import scenarios
    112120   
    113121    outputdir_tag = "_good_tri_area_0.01_A"
    114122    scenarios = [scenarios[1]] # !!!!!!!!!!!!!!!!!!!!!!
    115     dx = 0.001
     123    dx = 0.005
    116124    for run_data in scenarios:
    117125        point_x = arange(run_data['start_slope_x'],
     
    131139        interpolate_sww2csv(pro_instance.outputdir + basename +".sww",
    132140                            points,
    133                             pro_instance.outputdir + "slope_depth_" + end,
    134                             pro_instance.outputdir + "slope_velocity_x_" + end,
    135                             pro_instance.outputdir + "slope_velocity_y_" + end)
     141                            pro_instance.outputdir + "eslope_depth_" + end,
     142                            pro_instance.outputdir + "eslope_velocity_x_" + end,
     143                            pro_instance.outputdir + "eslope_velocity_y_" + end,
     144                            pro_instance.outputdir + "eslope_stage_" + end,
     145                            time_thinning=1)
    136146 
    137147   
     
    142152    """
    143153    """
     154    #gauges_for_slope()
    144155    auto_graph_slopes()
    145156
Note: See TracChangeset for help on using the changeset viewer.