Changeset 5447


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

Current Hinwood scenario

Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/fit_interpolate/interpolate.py

    r5403 r5447  
    430430                        stage_file=None,
    431431                        #quantities = ['depth', 'velocity'],
     432                        time_thinning=1,
    432433                        verbose=True,
    433434                        use_cache = True):
     
    436437    an sww file.
    437438    The results are written to a csv file.
     439   
     440    Time_thinning_number controls how many timesteps to use. Only
     441        timesteps with index%time_thinning_number == 0 will used, or
     442        in other words a value of 3, say, will cause the algorithm to
     443        use every third time step.
    438444
    439445    In the future let points be a points file.
     
    453459                                 interpolation_points=points,
    454460                                 verbose=verbose,
     461                                 time_thinning=time_thinning,
    455462                                 use_cache=use_cache)
    456463   
  • anuga_work/development/Hinwood_2008/run_dam.py

    r5426 r5447  
    6767    if run_type == 1:
    6868        outputdir_name += '_test'
    69         yieldstep = 0.1
     69        yieldstep = 1.0
    7070        finaltime = 15.
    71         maximum_triangle_area=0.01
     71        maximum_triangle_area=0.1
    7272       
    7373    elif run_type == 2:
     
    230230    #-------------------------------------------------------------------------
    231231
    232     if run_type >= 2:
     232    if run_type >= 1:
    233233        id = metadata_dic['scenario_id']
    234234        interpolate_sww2csv(pro_instance.outputdir + basename +".sww",
     
    253253
    254254    #4 is 0.01 5 is 0.001
    255     run_type = 4
    256     for run_data in [scenarios[5]]:
     255    run_type = 1
     256    #for run_data in [scenarios[5]]:
     257    for run_data in scenarios:
    257258        main( run_data['scenario_id'] + '_boundary.tsm'  , run_data,
    258259              run_type = run_type,
  • 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.