Index: /anuga_work/production/gold_coast_2009/export_results_max.py
===================================================================
--- /anuga_work/production/gold_coast_2009/export_results_max.py	(revision 7364)
+++ /anuga_work/production/gold_coast_2009/export_results_max.py	(revision 7365)
@@ -21,23 +21,32 @@
 
 directory = project.output_folder
+time_dir1 = '20090511_165539_run_final_0_50863_lfountai'
+time_dir2 = '20090714_162041_run_final_0.8_58292_None_kvanputt'
+time_dir3 = '20090714_161944_run_final_0.8_58280_None_kvanputt'
+time_dir4 = '20090714_161740_run_final_0.8_58260_None_kvanputt'
 
-time_dir1 = '20090605_120328_run_final_0_250m_51469_lfountai'
-##time_dir1 = '20090522_164640_run_final_1.1_51392_lfountai'
+time_dirs = [time_dir1]  
 
+# sww filename extensions ie. hobart_time_17640_0.sww, input into list 17640
+# make sure numbers are in sequential order
+times = []
+            
+#Modify the cellsize value to set the size of the raster you require
+#Take into account mesh size when aplying this paramater
+cellsize = 20 #250
 
-time_dirs = [time_dir1] #, time_dir2] #, time_dir3, time_dir4, time_dir5, time_dir6]   
+#Now set the timestep at which you want the raster generated.
+#Either set the actual timestep required or use 'None' to indicate that
+#you want the maximum values in the raster over all timesteps
+timestep = 0 
 
-cellsize = 250
-##cellsize = 20
+# Set the special areas of interest.  If none, do: area=['All']
+# Areas identified below are specified by cooridinates in project.py  
 
-#timestep = None    # None means no timestep!
-timestep = None
+#area = ['South', 'NW', 'Hobart'] 
+area = ['All']      
 
-######
-# Set the special areas of interest.  If none, do: area='All'
-######
-
-#area = ['Bunbury', 'Busselton']  # strings must match keys in var_equations below
-area = ['All']      # 'All' means no special areas - the whole thing
+# one or more key strings from var_equations below
+var = ['elevation']
 
 ######
@@ -51,9 +60,8 @@
                  'elevation': 'elevation' }
 
-# one or more key strings from var_equations above
-var = ['speed', 'depth']
 
 ######
-# Start running the various conversions we require.
+# Start script, running through variables, area, folder, sww file (determine by times)
+# Then creates a maximum asci if there is more than one sww file
 ######
 
@@ -80,19 +88,16 @@
 
         for time_dir in time_dirs:
+            names = [join(directory, time_dir, project.scenario_name)]
+            for time in times:
+                names.append(join(directory, time_dir, project.scenario_name)+ '_time_' + str(time) + '_0')
+            
+            asc_name = []   
+            print 'start sww2dem: time_dir = %s' % time_dir               
+            for name in names:
 
-            name1 = join(directory, time_dir, project.scenario_name)
-##            name2 = join(directory, time_dir, project.scenario_name)+'_time_29220_0'
-##            name3 = join(directory, time_dir, project.scenario_name)+'_time_58440_0'
-            
-            names = [name1] #, name2, name3]
-      
-            asc_name = []   
-               
-            for name in names:
-                         
                 outname = name + '_' + which_area + '_' + which_var
                 quantityname = var_equations[which_var]
 
-                print 'start sww2dem: time_dir=%s' % time_dir
+                print 'start sww2dem: name = %s' % os.path.basename(name)
                 
                 sww2dem(name, basename_out = outname,
@@ -109,9 +114,18 @@
 
                 asc_name.append(outname + '.asc')
-    
-##            maxasc_outname = join(directory, time_dir, project.scenario_name)+'_'+which_area+'_'+which_var+'_max.asc'
-##
-##            print 'max asc outname ', maxasc_outname
-##            print 'asc_name ', str(asc_name)
-##            
-##            MaxAsc(maxasc_outname, asc_name)
+            #print 'list = %s' % asc_name
+            #print 'max asc outname ', maxasc_outname
+            #print 'name=%s' % name
+            print 'which area=%s' % which_area
+            print 'which var=%s' % which_var
+            #print 'asc_name ', str(asc_name)
+            if len(names) >1:
+                maxasc_outname = join(directory, time_dir, project.scenario_name)+'_'+which_area+'_'+which_var+'_max.asc'
+
+                print 'max asc outname ', maxasc_outname
+                print 'asc_name ', str(asc_name)
+                
+                MaxAsc(maxasc_outname, asc_name)
+            else:
+                print 'Only one sww file, no Max file required' 
+
