Index: uga_work/production/australia_ph2/bamaga/Arc_asc2raster_GDA94z54.py
===================================================================
--- /anuga_work/production/australia_ph2/bamaga/Arc_asc2raster_GDA94z54.py	(revision 6974)
+++ 	(revision )
@@ -1,88 +1,0 @@
-# ---------------------------------------------------------------------------
-# This python script is an ArcGIS script that can only be run on a computer
-# with and ArcGIS licence and version 2.4.1 python.
-# This script is designed to read in .asc files and deliever rasters with
-# projection (GDA94z50) held in a file geodatabase (called raster)
-# written by Kristy Van Putten and Ross Wilson
-# ---------------------------------------------------------------------------
-
-# Import system modules
-import sys, string, os, arcgisscripting, glob, os.path
-
-# Create the Geoprocessor object
-gp = arcgisscripting.create()
-
-# Check out any necessary licenses
-gp.CheckOutExtension("spatial")
-
-# Load required toolboxes...
-gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Spatial Analyst Tools.tbx")
-gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Conversion Tools.tbx")
-gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx")
-gp.overwriteoutput = 1
-
-scenario_dir = "\\\\nas2\\gemd\\georisk_models\\inundation\\data\\australia_ph2\\gulf\\"
-output_dir="anuga\\outputs\\"
-
-#time_dir1 = '20090424_165617_run_final_0_71114_1914_Tb__jgriffin'
-time_dir2 = '20090424_103709_run_final_0_64977_1914_Tb__jgriffin'
-#time_dir3 = '20090409_001857_run_final_0_64322_1969_Tb__mhingee'
-
-events = [[time_dir2,0.464]]#,[time_dir1,0.469]]#,[time_dir3,0.418183]]
-
-for event in events:
-##for time_dir in time_dirs:
-    time_dir = event[0]
-    max_wave = event[1]
-    print time_dir
-    print max_wave
-    # Local variables...
-    folder = scenario_dir + output_dir +  time_dir +'\\'
-    raster_gbd = folder + 'raster.gdb'
-##    land = scenario_dir + "map_work\\\port_hedland.gdb\\outlines\\initial_condition"
-##    ocean = scenario_dir + "map_work\\\port_hedland.gdb\\outlines\\initial_conditions_ocean"
-
-    print 'Process: Create File GDB'
-    gp.CreateFileGDB_management(folder, "raster")
-
-    gp.Workspace = raster_gbd
-
-    print gp.Workspace
-    
-    #replication dictionary
-    replicate = (('portland', ''),('_', ''),('max','_M'),
-                 ('CBD', 'CDB'),('All',''),
-                 ('depth','_depth'),('speed', '_speed'),
-                 ('elevation', '_ele_'), ('stage','_stage'))
-
-    generate_filename = []
-    input_ascii = glob.glob(folder + '*.asc')
-
-    for infile in input_ascii:
-        output_DEM = os.path.basename(infile)[:-4]
-        for (key, rep) in replicate:
-            output_DEM = output_DEM.replace(key,rep)
-        output_DEM = output_DEM[:10]
-        if output_DEM in generate_filename:
-            print 'Output_DEM filename (%s) already in use' % output_DEM
-            sys.exit(10)
-        generate_filename.append(output_DEM)
-
-        print 'Output DEM ',output_DEM
-        
-        print 'Process: ASCII to Raster'
-        gp.ASCIIToRaster_conversion(infile, output_DEM, "FLOAT")
-
-        print 'Process: Define Projection' 
-        gp.DefineProjection_management(output_DEM, "PROJCS['GDA_1994_MGA_Zone_54',GEOGCS['GCS_GDA_1994',DATUM['D_GDA_1994',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]"
-                                                   ",PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',500000.0],PARAMETER['False_Northing',10000000.0],PARAMETER['Central_Meridian',141.0],PARAMETER['Scale_Factor',0.9996]"
-                                                   ",PARAMETER['Latitude_Of_Origin',0.0],UNIT['Meter',1.0]]")
-##        output_extract = output_DEM + 'E'
-##        print 'Output Extract ',output_extract
-##        print 'Process: Extract by Mask'
-##        gp.ExtractByMask_sa(output_DEM, land, output_extract)
-        # do this bit only if there are only stage asc files
-        div_file = output_DEM.replace('stage','div_stage')
-        print 'divide', output_DEM,' by', max_wave,' and call',div_file
-        gp.Divide_sa(output_DEM,max_wave,div_file)
-
Index: /anuga_work/production/australia_ph2/bamaga/build_elevation.py
===================================================================
--- /anuga_work/production/australia_ph2/bamaga/build_elevation.py	(revision 6974)
+++ /anuga_work/production/australia_ph2/bamaga/build_elevation.py	(revision 6975)
@@ -59,8 +59,6 @@
         dem2pts(absolute_filename, use_cache=True, verbose=True)
 
-        G_grid = Geospatial_data(file_name=absolute_filename+'.pts',
+        geospatial_data[filename] = Geospatial_data(file_name=absolute_filename+'.pts',
                                                     verbose=True)
-        print 'Clip geospatial object'
-        geospatial_data[filename] = G_grid.clip(project.bounding_polygon)
 
 # Create Geospatial data from TXT files
@@ -68,8 +66,6 @@
     for filename in project.point_filenames:
         absolute_filename = join(project.topographies_folder, filename)
-        G_points = Geospatial_data(file_name=absolute_filename,
+        geospatial_data[filename] = Geospatial_data(file_name=absolute_filename,
                                                     verbose=True)
-        print 'Clip geospatial object'
-        geospatial_data[filename] = G_points.clip(project.bounding_polygon)
 
 #-------------------------------------------------------------------------------
@@ -86,15 +82,15 @@
     G += geospatial_data[key]
         
-#print 'Clip combined geospatial data'
+print 'Clip combined geospatial data'
 ##G_clip = G.clip_outside(project.poly_aoi1)
 ##G_all = G_clip + geospatial_data[project.point_filenames[4]] 
 #G_clipped = G_all.clip(project.poly_all)
-#G_clip = G.clip(project.bounding_polygon)
+G_clip = G.clip(project.bounding_polygon)
 
 
 print 'Export combined DEM file'
-G.export_points_file(project.combined_elevation + '.pts')
+G_clip.export_points_file(project.combined_elevation + '.pts')
 print 'Do txt version too'
 # Use for comparision in ARC
-G.export_points_file(project.combined_elevation + '.txt')
+G_clip.export_points_file(project.combined_elevation + '.txt')
 
Index: uga_work/production/australia_ph2/bamaga/export_results.py
===================================================================
--- /anuga_work/production/australia_ph2/bamaga/export_results.py	(revision 6974)
+++ 	(revision )
@@ -1,121 +1,0 @@
-"""
-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)
-"""
-
-import project, os
-import sys
-from os.path import join
-from anuga.lib.maxasc.maxasc import MaxAsc
-from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts
-from anuga.shallow_water.data_manager import sww2dem
-from os import sep
-
-
-directory = project.output_folder
-
-time_dir1 = '20090408_152655_run_final_0_31975_2000_Tb__mhingee'
-time_dir2 = '20090421_135412_run_final_0_31975_2000_Tb_internal_lfountai'
-##time_dir3 = ''
-##time_dir4 = ''
-##time_dir5 = ''
-##time_dir6 = ''
-##
-time_dirs = [time_dir1, time_dir2]# , time_dir4, time_dir5, time_dir6]
-  
-
-cellsize = 250
-##cellsize = 5
-
-#timestep = None    # None means no timestep!
-timestep = 0
-
-######
-# 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
-
-######
-# Define allowed variable names and associated equations to generate values.
-# This would not normally change.
-######
-var_equations = {'stage':     'stage',
-                 'momentum':  '(xmomentum**2 + ymomentum**2)**0.5',
-                 'depth':     'stage-elevation',
-                 'speed':     '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6)',
-                 'elevation': 'elevation' }
-
-# one or more key strings from var_equations above
-var = ['elevation']
-
-######
-# Start running the various conversions we require.
-######
-
-for which_var in var:
-    if which_var not in var_equations:
-        print 'Unrecognized variable name: %s' % which_var
-        break
-
-    for which_area in area:
-        if which_area == 'All':
-            easting_min = None
-            easting_max = None
-            northing_min = None
-            northing_max = None
-        else:
-            try:
-                easting_min = eval('project.xmin%s' % which_area)
-                easting_max = eval('project.xmax%s' % which_area)
-                northing_min = eval('project.ymin%s' % which_area)
-                northing_max = eval('project.ymax%s' % which_area)
-            except AttributeError:
-                print 'Unrecognized area name: %s' % which_area
-                break
-
-        for time_dir in time_dirs:
-
-            name1 = join(directory, time_dir, project.scenario_name)
-            #name2 = join(directory, time_dir, project.scenario_name)+'_time_39600_0'
-            #name3 = join(directory, time_dir, project.scenario_name)+'_time_79200_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
-                
-                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')
-
-##                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)
Index: /anuga_work/production/australia_ph2/bamaga/export_results_max.py
===================================================================
--- /anuga_work/production/australia_ph2/bamaga/export_results_max.py	(revision 6974)
+++ /anuga_work/production/australia_ph2/bamaga/export_results_max.py	(revision 6975)
@@ -22,11 +22,9 @@
 directory = project.output_folder
 
-##time_dir1 = '20090408_152655_run_final_0_31975_2000_Tb__mhingee'
-##time_dir2 = '20090409_123239_run_final_0_51390_2000_Tb__mhingee'
-##time_dir3 = '20090410_110658_run_final_0_63735_2000_Tb__mhingee'
+time_dir1 = '20090408_152655_run_final_0_31975_2000_Tb__mhingee'
+time_dir2 = '20090409_123239_run_final_0_51390_2000_Tb__mhingee'
+time_dir3 = '20090410_110658_run_final_0_63735_2000_Tb__mhingee'
 
-time_dir1 = '20090421_135412_run_final_0_31975_2000_Tb_internal_lfountai'
-
-time_dirs = [time_dir1]#, time_dir2, time_dir3]
+time_dirs = [time_dir1, time_dir2, time_dir3]
 
 cellsize = 250
@@ -84,7 +82,6 @@
 
             name1 = join(directory, time_dir, project.scenario_name)
-##            name2 = join(directory, time_dir, project.scenario_name)+'_time_37920_0'
-            name2 = join(directory, time_dir, project.scenario_name)+'_time_37860_0'
-            
+            name2 = join(directory, time_dir, project.scenario_name)+'_time_37920_0'
+
             names = [name1, name2]
 
Index: /anuga_work/production/australia_ph2/bamaga/project.py
===================================================================
--- /anuga_work/production/australia_ph2/bamaga/project.py	(revision 6974)
+++ /anuga_work/production/australia_ph2/bamaga/project.py	(revision 6975)
@@ -20,5 +20,5 @@
 
 #-------------------------------------------------------------------------------
-# Initial Conditions 
+# Initial Conditions
 #-------------------------------------------------------------------------------
 
@@ -38,5 +38,5 @@
 tide = 0                # difference between MSL and HAT
 alpha = 0.1             # smoothing parameter for mesh
-friction = 0.01           # manning's friction coefficient
+friction=0.01           # manning's friction coefficient
 starttime=0             # start time for simulation
 finaltime=60000 # final time for simulation
Index: /anuga_work/production/australia_ph2/bamaga/run_model.py
===================================================================
--- /anuga_work/production/australia_ph2/bamaga/run_model.py	(revision 6974)
+++ /anuga_work/production/australia_ph2/bamaga/run_model.py	(revision 6975)
@@ -87,25 +87,14 @@
 # Number of boundary segments
 num_ocean_segments = len(event_sts) - 1
-print num_ocean_segments
 # Number of landward_boundary points
 num_land_points = file_length(project.landward_boundary)
-print num_land_points
+
 # Boundary tags refer to project.landward_boundary
 # 4 points equals 5 segments start at N
-boundary_tags={'back': range(num_ocean_segments+2,
-                             num_ocean_segments+5),
+boundary_tags={'back': range(num_ocean_segments+1,
+                             num_ocean_segments+num_land_points),
                'side': [num_ocean_segments,
-                        num_ocean_segments+1,
-                        num_ocean_segments+5,
-                        num_ocean_segments+6,
-                        num_ocean_segments+7,
-                        num_ocean_segments+8,
-                        num_ocean_segments+9],
+                        num_ocean_segments+num_land_points],
                'ocean': range(num_ocean_segments)}
-##boundary_tags = {'back':[3],
-##                 'side':[2,4],
-##                 'ocean':[0,1,5]}
-
-print 'boundary tags', boundary_tags
 
 # Build mesh and domain
