Index: /anuga_work/production/perth/build_boundary_27255.py
===================================================================
--- /anuga_work/production/perth/build_boundary_27255.py	(revision 5760)
+++ /anuga_work/production/perth/build_boundary_27255.py	(revision 5761)
@@ -1,9 +1,9 @@
 """
-build_boundary script creates a sts file and csv files.
-The sts files is necessary for run_perth.py 
-The csv files are timeseries of the sts file determining the wave input
+Script for building boundary to run tsunami inundation scenario for Perth,
+WA, Australia.  The boundary is based on the National Hazard Map.
 
-This script is determined by an inidividual event generated through
-the Hazard map, refer to David Burbidge for details of inidivdual events
+Input: order_filename from project.py
+Output: creates a sts file and csv files stored in project.boundaries_dir_event.
+The run_perth.py is reliant on the output of this script.
 """
 import os
@@ -102,9 +102,31 @@
         s = '%d, %.6f, %.6f, %.6f\n' %(index, x[j], y[j], max(stage))
         fid_max.write(s)
+      
+#------------------------------------------------------------------------------
+# Get Minium wave height throughout timeseries at each index point
+#------------------------------------------------------------------------------
+
+    minname = 'min_sts_stage.csv'
+    fid_min = open(project.boundaries_dir_event+sep+maxname,'w')
+    s = 'index, x, y, max_stage \n'
+    fid_min.write(s)    
+    for j in range(len(x)):
+        index= permutation[j]
+        stage = quantities['stage'][:,j]
+        xmomentum = quantities['xmomentum'][:,j]
+        ymomentum = quantities['ymomentum'][:,j]
+
+        s = '%d, %.6f, %.6f, %.6f\n' %(index, x[j], y[j], min(stage))
+        fid_min.write(s)
         
+
+
         fid_sts = open(project.boundaries_dir_event+sep+basename+'_'+ str(index)+'.csv', 'w')
         s = 'time, stage, xmomentum, ymomentum \n'
         fid_sts.write(s)
-        
+
+#------------------------------------------------------------------------------
+# End of the get gauges
+#------------------------------------------------------------------------------
         for k in range(len(time)-1):
             s = '%.6f, %.6f, %.6f, %.6f\n' %(time[k], stage[k], xmomentum[k], ymomentum[k])
@@ -114,5 +136,6 @@
 
     fid.close()
-        
+
+
     return quantities,elevation,time
 
Index: /anuga_work/production/perth/build_boundary_27283.py
===================================================================
--- /anuga_work/production/perth/build_boundary_27283.py	(revision 5760)
+++ /anuga_work/production/perth/build_boundary_27283.py	(revision 5761)
@@ -1,9 +1,9 @@
 """
-build_boundary script creates a sts file and csv files.
-The sts files is necessary for run_perth.py 
-The csv files are timeseries of the sts file determining the wave input
+Script for building boundary to run tsunami inundation scenario for Perth,
+WA, Australia.  The boundary is based on the National Hazard Map.
 
-This script is determined by an inidividual event generated through
-the Hazard map, refer to David Burbidge for details of inidivdual events
+Input: order_filename from project.py
+Output: creates a sts file and csv files stored in project.boundaries_dir_event.
+The run_perth.py is reliant on the output of this script.
 """
 import os
@@ -141,9 +141,31 @@
         s = '%d, %.6f, %.6f, %.6f\n' %(index, x[j], y[j], max(stage))
         fid_max.write(s)
+      
+#------------------------------------------------------------------------------
+# Get Minium wave height throughout timeseries at each index point
+#------------------------------------------------------------------------------
+
+    minname = 'min_sts_stage.csv'
+    fid_min = open(project.boundaries_dir_event+sep+maxname,'w')
+    s = 'index, x, y, max_stage \n'
+    fid_min.write(s)    
+    for j in range(len(x)):
+        index= permutation[j]
+        stage = quantities['stage'][:,j]
+        xmomentum = quantities['xmomentum'][:,j]
+        ymomentum = quantities['ymomentum'][:,j]
+
+        s = '%d, %.6f, %.6f, %.6f\n' %(index, x[j], y[j], min(stage))
+        fid_min.write(s)
         
+
+
         fid_sts = open(project.boundaries_dir_event+sep+basename+'_'+ str(index)+'.csv', 'w')
         s = 'time, stage, xmomentum, ymomentum \n'
         fid_sts.write(s)
-        
+
+#------------------------------------------------------------------------------
+# End of the get gauges
+#------------------------------------------------------------------------------
         for k in range(len(time)-1):
             s = '%.6f, %.6f, %.6f, %.6f\n' %(time[k], stage[k], xmomentum[k], ymomentum[k])
@@ -153,5 +175,6 @@
 
     fid.close()
-        
+
+
     return quantities,elevation,time
 
Index: /anuga_work/production/perth/build_perth.py
===================================================================
--- /anuga_work/production/perth/build_perth.py	(revision 5760)
+++ /anuga_work/production/perth/build_perth.py	(revision 5761)
@@ -1,11 +1,8 @@
-"""Script for running tsunami inundation scenario for Perth, WA, Australia.
+"""
+Script for building the elevation data to run tsunami inundation scenario
+for Perth, WA, Australia.
 
-Source data such as elevation and boundary data is assumed to be available in
-directories specified by project.py
-The output sww file is stored in project.output_time_dir 
-
-The scenario is defined by a triangular mesh created from project.polygon,
-the elevation data and a simulated submarine landslide.
-
+Input: elevation data from project.py
+Output: pts file stored in project.topographies_dir 
 The run_perth.py is reliant on the output of this script.
 
Index: /anuga_work/production/perth/export_results_all.py
===================================================================
--- /anuga_work/production/perth/export_results_all.py	(revision 5760)
+++ /anuga_work/production/perth/export_results_all.py	(revision 5761)
@@ -1,4 +1,10 @@
 """
-Generates ascii grids of nominated areas - need sww file created in run_perth.py
+Generates ascii grids of nominated areas -
+Input: sww file from run_perth.py
+       boundaries for grids from project.py
+Outputs: ascii grids of specified variables
+Stored in the 'outputs_dir' folder for respective .sww file
+
+Note:
 If producing a grid for the enitre extent cellsize should be greater than 30m
 If producing grids for inundation area resolution should be greater than mesh (ie ~22m)
@@ -12,8 +18,10 @@
 from os import sep
 
+directory = project.output_dir
+
 #time_dir = '20080526_104946_run_final_0.6_test_kvanputt'
 #time_dir = '20080530_170833_run_final_0.6_exmouth_kvanputt'
-#time_dir = '20080815_103442_run_final_0.0_polyline_alpha0.1_kvanputt'
-time_dir = '20080909_151438_run_final_0.0_polyline_alpha0.1_kvanputt'
+time_dir1 = '20080815_103442_run_final_0.0_polyline_alpha0.1_kvanputt'
+time_dir2 = '20080909_151438_run_final_0.0_polyline_alpha0.1_kvanputt'
 
 #cellsize = 20
@@ -26,84 +34,85 @@
 var = [0,4] #stage and elevation
 
+time_dir = [time_dir1, time_dir2]
+for time_dir in time_dirs:
 
-directory = project.output_dir
-name1 = directory+time_dir+sep+project.scenario_name
-name2 = directory+time_dir+sep+'sww2'+sep+project.scenario_name+'_time_39900_0'
+    name1 = directory+time_dir+sep+project.scenario_name
+    name2 = directory+time_dir+sep+'sww2'+sep+project.scenario_name+'_time_39900_0' #need to get assistance on how to make this into anything
 
-names = [name1, name2]
-for name in names:
+    names = [name1, name2]
+    for name in names:
 
-    for which_area in area:
-        if which_area == 'All':
-        
-        if which_area == 'Geordie':
-            easting_min = project.xminGeordie
-            easting_max = project.xmaxGeordie
-            northing_min = project.yminGeordie
-            northing_max = project.ymaxGeordie
+        for which_area in area:
+            if which_area == 'All':
+            
+            if which_area == 'Geordie':
+                easting_min = project.xminGeordie
+                easting_max = project.xmaxGeordie
+                northing_min = project.yminGeordie
+                northing_max = project.ymaxGeordie
 
-        if which_area == 'Sorrento':
-            easting_min = project.xminSorrento
-            easting_max = project.xmaxSorrento
-            northing_min = project.yminSorrento
-            northing_max = project.ymaxSorrento
+            if which_area == 'Sorrento':
+                easting_min = project.xminSorrento
+                easting_max = project.xmaxSorrento
+                northing_min = project.yminSorrento
+                northing_max = project.ymaxSorrento
 
-        if which_area == 'Fremantle':
-            easting_min = project.xminFremantle
-            easting_max = project.xmaxFremantle
-            northing_min = project.yminFremantle
-            northing_max = project.ymaxFremantle
+            if which_area == 'Fremantle':
+                easting_min = project.xminFremantle
+                easting_max = project.xmaxFremantle
+                northing_min = project.yminFremantle
+                northing_max = project.ymaxFremantle
 
-        if which_area == 'Rockingham':
-            easting_min = project.xminRockingham
-            easting_max = project.xmaxRockingham
-            northing_min = project.yminRockingham
-            northing_max = project.ymaxRockingham
+            if which_area == 'Rockingham':
+                easting_min = project.xminRockingham
+                easting_max = project.xmaxRockingham
+                northing_min = project.yminRockingham
+                northing_max = project.ymaxRockingham
 
-          
-        for which_var in var:
-            if which_var == 0:  # Stage
-                outname = name + which_area + '_stage' 
-                quantityname = 'stage'
+              
+            for which_var in var:
+                if which_var == 0:  # Stage
+                    outname = name + which_area + '_stage' 
+                    quantityname = 'stage'
 
-            if which_var == 1:  # Absolute Momentum
-                outname = name + which_area + '_momentum' 
-                quantityname = '(xmomentum**2 + ymomentum**2)**0.5'  
+                if which_var == 1:  # Absolute Momentum
+                    outname = name + which_area + '_momentum' 
+                    quantityname = '(xmomentum**2 + ymomentum**2)**0.5'  
 
-            if which_var == 2:  # Depth
-                outname = name + which_area + '_depth'
-                quantityname = 'stage-elevation'  
+                if which_var == 2:  # Depth
+                    outname = name + which_area + '_depth'
+                    quantityname = 'stage-elevation'  
 
-            if which_var == 3:  # Speed
-                outname = name + which_area + '_speed'
-                #quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))'  #Speed
-                quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6)'  #Speed
-                
-            if which_var == 4:  # Elevation
-                outname = name + which_area + '_elevation'
-                quantityname = 'elevation'  #Elevation
+                if which_var == 3:  # Speed
+                    outname = name + which_area + '_speed'
+                    #quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))'  #Speed
+                    quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6)'  #Speed
+                    
+                if which_var == 4:  # Elevation
+                    outname = name + which_area + '_elevation'
+                    quantityname = 'elevation'  #Elevation
 
-            if which_area == 'All'
-                print 'start sww2dem',which_area
-                sww2dem(name, basename_out = outname,
-                            quantity = quantityname,
-                            #timestep = timestep,
-                            cellsize = cellsize,      
-                            reduction = max, 
-                            verbose = True,
-                            format = 'asc')
+                if which_area == 'All'
+                    print 'start sww2dem',which_area
+                    sww2dem(name, basename_out = outname,
+                                quantity = quantityname,
+                                #timestep = timestep,
+                                cellsize = cellsize,      
+                                reduction = max, 
+                                verbose = True,
+                                format = 'asc')
 
-            else:
-                print 'start sww2dem',which_area, easting_min
-                sww2dem(name, basename_out = outname,
-                            quantity = quantityname,
-                            #timestep = timestep,
-                            cellsize = cellsize,      
-                            easting_min = easting_min,
-                            easting_max = easting_max,
-                            northing_min = northing_min,
-                            northing_max = northing_max,        
-                            reduction = max, 
-                            verbose = True,
-                            format = 'asc')
+                else:
+                    print 'start sww2dem',which_area, easting_min
+                    sww2dem(name, basename_out = outname,
+                                quantity = quantityname,
+                                #timestep = timestep,
+                                cellsize = cellsize,      
+                                easting_min = easting_min,
+                                easting_max = easting_max,
+                                northing_min = northing_min,
+                                northing_max = northing_max,        
+                                reduction = max, 
+                                verbose = True,
+                                format = 'asc')
 
Index: /anuga_work/production/perth/get_timeseries.py
===================================================================
--- /anuga_work/production/perth/get_timeseries.py	(revision 5760)
+++ /anuga_work/production/perth/get_timeseries.py	(revision 5761)
@@ -1,6 +1,10 @@
 """
-Generate time series of nominated "gauges" read from project.gauge_filename. This 
-is done by running sww2csv_gauges to make 'csv' files in the 'output_dir' containing
-the details at the gauges for both these sww files.
+Generate time series of nominated "gauges".
+Input: sww file from run_perth.py
+       gauges project.gauge_filename
+Output: csv files stage,speed,depth,elevation over time
+Stored in the 'outputs_dir' folder for respective .sww file
+
+Note:
 Can run different sww files at the same time
 make sure if there is a second sww file that it is placed into a folder called sww2
Index: /anuga_work/production/perth/project.py
===================================================================
--- /anuga_work/production/perth/project.py	(revision 5760)
+++ /anuga_work/production/perth/project.py	(revision 5761)
@@ -1,4 +1,4 @@
-"""Common filenames and locations for topographic data, meshes and outputs.
-Simplified and Commented by Kristy Van Putten
+"""Common filenames and locations for elevation, meshes and outputs.
+This script is the heart of all scripts in folder
 """
 #------------------------------------------------------------------------------
Index: /anuga_work/production/perth/run_perth.py
===================================================================
--- /anuga_work/production/perth/run_perth.py	(revision 5760)
+++ /anuga_work/production/perth/run_perth.py	(revision 5761)
@@ -1,11 +1,14 @@
 """Script for running tsunami inundation scenario for Perth, WA, Australia.
-
-Source data such as elevation and boundary data is assumed to be available in
-directories specified by project.py
-The output sww file is stored in project.output_run_time_dir 
 
 The scenario is defined by a triangular mesh created from project.polygon,
 the elevation data is combiled into a pts file through build_perth.py
 and a simulated tsunami is generated through an sts file from build_boundary.py
+
+Input: sts file (build_boundary.py for resepective event)
+       pts file (build_perth.py)
+       information from project file
+Outputs: sww file stored in project.output_run_time_dir 
+The export_results_all.py and get_timeseries.py is reliant
+on the outputs of this script
 
 Ole Nielsen and Duncan Gray, GA - 2005, Jane Sexton, Nick Bartzis, GA - 2006
