Index: /anuga_work/development/Hinwood_2008/plot.py
===================================================================
--- /anuga_work/development/Hinwood_2008/plot.py	(revision 5454)
+++ /anuga_work/development/Hinwood_2008/plot.py	(revision 5455)
@@ -18,5 +18,5 @@
     """
     from pylab import ion, plot, xlabel, ylabel, close, legend, \
-         savefig, title
+         savefig, title, axis
     from anuga.shallow_water.data_manager import csv2dict
 
@@ -44,4 +44,5 @@
     legend((legend_sim, legend_exp),'upper left')
     title(plot_title)
+    #axis([0,60,0.380,0.420])
     
     if is_interactive:
@@ -55,6 +56,11 @@
     close()
     
-def Hinwood_files_locations(run_data, outputdir_tag, plot_type):
-    
+def Hinwood_files_locations(run_data, outputdir_tag, plot_type,
+                            quantity = "depth"):
+    """
+    run_data is a dictionary of data describing a Hinwood experiment
+    outputdir_tag a string at the end of an output dir; '_good_tri_area_0.01_A'
+    plot_type the file extension of the plot, eg '.pdf'
+    """
     id = run_data['scenario_id']
     outputdir_name = id + outputdir_tag
@@ -62,7 +68,8 @@
                                    outputdir_name=outputdir_name)
     
-    file_sim = pro_instance.outputdir + "depth_" + id + ".csv"
+    file_sim = pro_instance.outputdir + quantity + "_" + id + ".csv"
     #print "file_exp",file_exp
-    file_exp = pro_instance.raw_data_dir + sep + id + 'pressfilt_exp_depth.csv'
+    file_exp = pro_instance.raw_data_dir + sep + id + 'pressfilt_exp_' \
+               + quantity + '.csv'
     #print "file_sim", file_sim
     location_sims = []
@@ -74,18 +81,16 @@
         location_exps.append(gauge_x)
         save_as_list.append(pro_instance.plots_dir + sep + \
-                            outputdir_name + "_" + gauge_x + plot_type)
+                            outputdir_name + "_" + quantity + "_" + \
+                            gauge_x + plot_type)
     return file_exp, file_sim, location_sims, location_exps, outputdir_name, \
            save_as_list
-def plot():
-    from scenarios import scenarios
-    outputdir_tag = "_good_tri_area_0.01_A"
-    outputdir_tag = "_test"
-    #scenarios = scenarios[1] # !!!!!!!!!!!!!!!!!!!!!! 
-    #scenarios = [scenarios[5]] # !!!!!!!!!!!!!!!!!!!!!! 
-    # Supported formats: emf, eps, pdf, png, ps, raw, rgba, svg, svgz.
+def plot(scenarios, outputdir_tag, quantity = "stage"):
     plot_type = ".pdf"
+    
     for run_data in scenarios:
         
-        temp = Hinwood_files_locations(run_data, outputdir_tag, plot_type)
+        temp = Hinwood_files_locations(run_data, outputdir_tag,
+                                       plot_type, quantity)
+                                    
         file_exp, file_sim, location_sims, location_exps, outputdir_name, \
                   save_as_list = temp
@@ -109,5 +114,5 @@
                              file_exp=file_exp,
                              plot_title=plot_title,
-                             y_label='Water height (m)',
+                             y_label='Water '+ quantity +' (m)',
                              is_interactive=False,
                              save_as=save_as)
@@ -118,35 +123,7 @@
     """
     from scenarios import scenarios
-    outputdir_tag = "_good_tri_area_0.01_A"
-    #scenarios = scenarios[1] # !!!!!!!!!!!!!!!!!!!!!! 
-    scenarios = [scenarios[5]] # !!!!!!!!!!!!!!!!!!!!!! 
-    # Supported formats: emf, eps, pdf, png, ps, raw, rgba, svg, svgz.
-    plot_type = ".pdf"
-    for run_data in scenarios:
-        
-        temp = Hinwood_files_locations(run_data, outputdir_tag, plot_type)
-        file_exp, file_sim, location_sims, location_exps, outputdir_name, \
-                  save_as_list = temp
-        print "run_data['scenario_id']", run_data['scenario_id']
-        #location_sims = [location_sims[0]]
-        #location_exps = [location_exps[0]]
-        #save_as_list = [save_as_list[0]]
-        for loc_sim, loc_exp, save_as, gauge in map(None, location_sims,
-                                                    location_exps,
-                                                    save_as_list,
-                                                    run_data['gauge_x']):
-            time_date = strftime('plot date: %d/%m/%Y Time: %H:%M:%S',
-                                      localtime())
-            plot_title = "Scenario: " + outputdir_name + "\n" + \
-                         "X Gauge (m):" + str(gauge) + "    " + time_date
-                         
-            print "Doing ", plot_title
-            plot_compare_csv(location_sim=loc_sim,
-                             file_sim=file_sim,
-                             location_exp=loc_exp,
-                             file_exp=file_exp,
-                             plot_title=plot_title,
-                             y_label='Water height (m)',
-                             is_interactive=False,
-                             save_as=save_as)
+    outputdir_tag = "_test_C"
+    #scenarios = scenarios[1]
+    #scenarios = [scenarios[5]] 
+    plot(scenarios, outputdir_tag)
 
Index: /anuga_work/development/Hinwood_2008/prepare_time_boundary.py
===================================================================
--- /anuga_work/development/Hinwood_2008/prepare_time_boundary.py	(revision 5454)
+++ /anuga_work/development/Hinwood_2008/prepare_time_boundary.py	(revision 5455)
@@ -1,4 +1,3 @@
 """
-
 Script for running a breaking wave simulation of Jon Hinwoods wave tank.
 Note: this is based on the frinction_ua_flume_2006 structure.
@@ -6,6 +5,4 @@
 
 Duncan Gray, GA - 2007 
-
-
 
 """
@@ -203,4 +200,8 @@
     #print "start_time", start_time
 
+    
+    bed_elevation_list = metadata_dic['gauge_bed_elevation']
+    # +2 due to Time column and gauge A
+    max_j = len(bed_elevation_list)+2
     # Write a header
     fid.write('Time')
@@ -212,6 +213,7 @@
         # Don't write sensor A.
         # It is the boundary condition.
-        for j, bed_elevation in map(None,xrange(2,len(sensors[0])),
-                                       metadata_dic['gauge_bed_elevation']):
+        for j, bed_elevation in map(None,
+                                    xrange(2,max_j),
+                                    bed_elevation_list):
             # depth, m
             gauge = sensors[i,j]/1000 - bed_elevation # Convert from mm to m
@@ -219,4 +221,27 @@
         fid.write('\n')
     fid.close()
+
+    
+    # Since there is a new time reference save the stage info using this
+    # new reference.
+    fid = open(depth_file[:-4] + '_exp_stage.csv','w')
+    sensors[:,0] -= start_time
+    
+    # Write a header
+    fid.write('Time')
+    for gauge_x in metadata_dic['gauge_x']:
+        fid.write(',' + str(gauge_x)) 
+    fid.write('\n')
+    for i in xrange(len(dtimes)):       
+        fid.write(str(sensors[i,0])) # Time
+        # Don't write sensor A.
+        # It is the boundary condition.
+        for j in xrange(2,max_j):
+            # stage, m
+            gauge = sensors[i,j]/1000 # Convert from mm to m
+            fid.write(',' + str(gauge)) 
+        fid.write('\n')
+    fid.close()
+    
     return final_time
 
Index: /anuga_work/development/Hinwood_2008/run_dam.py
===================================================================
--- /anuga_work/development/Hinwood_2008/run_dam.py	(revision 5454)
+++ /anuga_work/development/Hinwood_2008/run_dam.py	(revision 5455)
@@ -66,5 +66,5 @@
     basename = 'zz_' + metadata_dic['scenario_id']
     if run_type == 1:
-        outputdir_name += '_test'
+        outputdir_name += '_test_C'
         yieldstep = 1.0
         finaltime = 15.
@@ -83,5 +83,5 @@
         maximum_triangle_area=0.001
     elif run_type == 4:
-        outputdir_name += '_good_tri_area_0.01_A'
+        outputdir_name += '_good_tri_area_0.01_C'
         # this is not a test
         # Output will go to a file
@@ -91,5 +91,5 @@
         maximum_triangle_area=0.01
     elif run_type == 5:
-        outputdir_name += '_good_tri_area_0.001_A'
+        outputdir_name += '_good_tri_area_0.001_C'
         # this is not a test
         # Output will go to a file
@@ -98,12 +98,4 @@
         finaltime = None        
         maximum_triangle_area=0.001
-    elif run_type == 6:
-        outputdir_name += '_good_tri_area_0.0001_A'
-        # this is not a test
-        # Output will go to a file
-        # The sww file will be interpolated
-        yieldstep = 0.01
-        finaltime = None        
-        maximum_triangle_area=0.0001
      
     metadata_dic = set_z_origin_to_water_depth(metadata_dic)    
@@ -231,10 +223,11 @@
 
     if run_type >= 1:
-        id = metadata_dic['scenario_id']
+        id = metadata_dic['scenario_id'] + ".csv"
         interpolate_sww2csv(pro_instance.outputdir + basename +".sww",
                             points,
-                            pro_instance.outputdir + "depth_" + id + ".csv",
-                            pro_instance.outputdir + "velocity_x_" + id + ".csv",
-                            pro_instance.outputdir + "velocity_y_" + id + ".csv")
+                            pro_instance.outputdir + "depth_" + id,
+                            pro_instance.outputdir + "velocity_x_" + id,
+                            pro_instance.outputdir + "velocity_y_" + id,
+                            pro_instance.outputdir + "stage_" + id)
   
     return pro_instance
@@ -254,11 +247,12 @@
 
 
-    #4 is 0.01 5 is 0.001
-    run_type = 5
+    # 4 is 0.01
+    # 5 is 0.001
+    run_type = 1
     #for run_data in [scenarios[5]]:
     for run_data in scenarios:
-        main( run_data['scenario_id'] + '_boundary.tsm'  , run_data,
-              run_type = run_type,
-              outputdir_name=run_data['scenario_id'])
-    gauges_for_slope()
-    #plot()
+        pro_instance = main( run_data['scenario_id'] + '_boundary.tsm'  ,
+                             run_data,
+                             run_type = run_type,
+                             outputdir_name=run_data['scenario_id'])
+        gauges_for_slope(pro_instance.outputdir,[run_data])
Index: /anuga_work/development/Hinwood_2008/slope.py
===================================================================
--- /anuga_work/development/Hinwood_2008/slope.py	(revision 5454)
+++ /anuga_work/development/Hinwood_2008/slope.py	(revision 5455)
@@ -85,5 +85,5 @@
     xlabel('x location')
     ylabel('Time, seconds')
-    axis([5.0, 5.5, 30, 60])
+    #axis([5.0, 5.5, 30, 60])
 
 
@@ -104,5 +104,6 @@
     
     outputdir_tag = "_good_tri_area_0.01_A"
-    outputdir_tag = "_test"
+    outputdir_tag = "_good_tri_area_0.01_old"
+    #outputdir_tag = "_test"
     scenarios = [scenarios[1]] # !!!!!!!!!!!!!!!!!!!!!!
     for run_data in scenarios:
@@ -112,15 +113,14 @@
                                        outputdir_name=outputdir_name)
         end = id + ".csv"
-        slope_file = pro_instance.outputdir + "d3slope_stage_" + end
+        slope_file = pro_instance.outputdir + "bslope_stage_" + end
         graph_slopes(slope_file, run_data['break_xs'],
                      run_data['break_times']) 
     
-def gauges_for_slope():
-    from scenarios import scenarios
+def gauges_for_slope(outputdir_tag, scenarios):
     
     outputdir_tag = "_good_tri_area_0.01_A"
-    outputdir_tag = "_test"
-    #scenarios = [scenarios[1]] # !!!!!!!!!!!!!!!!!!!!!!
-    dx = 0.005
+    #outputdir_tag = "_test"
+    #scenarios = [scenarios[0]] # !!!!!!!!!!!!!!!!!!!!!!
+    dx = 0.05
     for run_data in scenarios:
         point_x = arange(run_data['start_slope_x'],
@@ -140,8 +140,8 @@
         interpolate_sww2csv(pro_instance.outputdir + basename +".sww",
                             points,
-                            pro_instance.outputdir + "eslope_depth_" + end,
-                            pro_instance.outputdir + "eslope_velocity_x_" + end,
-                            pro_instance.outputdir + "eslope_velocity_y_" + end,
-                            pro_instance.outputdir + "eslope_stage_" + end,
+                            pro_instance.outputdir + "fslope_depth_" + end,
+                            pro_instance.outputdir + "fslope_velocity_x_" + end,
+                            pro_instance.outputdir + "fslope_velocity_y_" + end,
+                            pro_instance.outputdir + "fslope_stage_" + end,
                             time_thinning=1)
   
@@ -153,5 +153,7 @@
     """ 
     """
-    #gauges_for_slope()
-    auto_graph_slopes() 
+    from scenarios import scenarios
+    scenarios = [scenarios[0]]
+    #gauges_for_slope("_good_tri_area_0.01_A", scenarios)
+    #auto_graph_slopes() 
 
