Index: /anuga_work/production/broome_2006/locate_indigeneous.py
===================================================================
--- /anuga_work/production/broome_2006/locate_indigeneous.py	(revision 4422)
+++ /anuga_work/production/broome_2006/locate_indigeneous.py	(revision 4423)
@@ -36,5 +36,5 @@
 filename_out = project.community_broome
 fid_out = open(filename_out, 'w')
-extent = project.polyAll
+extent = project.poly_all
 zone = 51
 
Index: /anuga_work/production/dampier_2006/export_results.py
===================================================================
--- /anuga_work/production/dampier_2006/export_results.py	(revision 4422)
+++ /anuga_work/production/dampier_2006/export_results.py	(revision 4423)
@@ -5,5 +5,6 @@
 from os import sep
 
-time_dir = '20070418_035124_run' #
+time_dir = '20070419_065050_run' # HAT
+#time_dir = '20070419_065018_run' # MSL
 cellsize = 25
 timestep = None
@@ -16,34 +17,47 @@
 print 'output dir:', name
 
-which_var = 2
-if which_var == 0:  # Stage
-    outname = name + '_stage'
-    quantityname = 'stage'
+var = [2,3] # depth and speed
 
-if which_var == 1:  # Absolute Momentum
-    outname = name + '_momentum_i1'
-    quantityname = '(xmomentum**2 + ymomentum**2)**0.5'  
+for which_var in var:
+    if which_var == 0:  # Stage
+        outname = name + '_stage'
+        quantityname = 'stage'
 
-if which_var == 2:  # Depth
-    outname = name + '_depth'
-    quantityname = 'stage-elevation'  
+    if which_var == 1:  # Absolute Momentum
+        outname = name + '_momentum_i1'
+        quantityname = '(xmomentum**2 + ymomentum**2)**0.5'  
 
-if which_var == 3:  # Speed
-    outname = name + '_speed_i0'
-    quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))'  #Speed
+    if which_var == 2:  # Depth
+        outname = name + '_depth_facility'
+        quantityname = 'stage-elevation'  
 
-if which_var == 4:  # Elevation
-    outname = name + '_elevation'
-    quantityname = 'elevation'  #Elevation
+    if which_var == 3:  # Speed
+        outname = name + '_speed_facility'
+        quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))'  #Speed
 
+    if which_var == 4:  # Elevation
+        outname = name + '_elevation'
+        quantityname = 'elevation'  #Elevation
 
-
-if is_parallel == True:
-#    print 'is_parallel',is_parallel
-    for i in range(0,nodes):
-        namei = name + '_P%d_%d' %(i,nodes)
-        outnamei = outname + '_P%d_%d' %(i,nodes)
-        print 'start sww2dem for sww file %d' %(i)
-        sww2dem(namei, basename_out = outnamei,
+    if is_parallel == True:
+    #    print 'is_parallel',is_parallel
+        for i in range(0,nodes):
+            namei = name + '_P%d_%d' %(i,nodes)
+            outnamei = outname + '_P%d_%d' %(i,nodes)
+            print 'start sww2dem for sww file %d' %(i)
+            sww2dem(namei, basename_out = outnamei,
+                        quantity = quantityname,
+                        timestep = timestep,
+                        cellsize = cellsize,      
+                        easting_min = project.e_min_area,
+                        easting_max = project.e_max_area,
+                        northing_min = project.n_min_area,
+                        northing_max = project.n_max_area,        
+                        reduction = max, 
+                        verbose = True,
+                        format = 'asc')
+    else:
+        print 'start sww2dem'
+        sww2dem(name, basename_out = outname,
                     quantity = quantityname,
                     timestep = timestep,
@@ -56,15 +70,2 @@
                     verbose = True,
                     format = 'asc')
-else:
-    print 'start sww2dem'
-    sww2dem(name, basename_out = outname,
-                quantity = quantityname,
-                timestep = timestep,
-                cellsize = cellsize,      
-                easting_min = project.e_min_area,
-                easting_max = project.e_max_area,
-                northing_min = project.n_min_area,
-                northing_max = project.n_max_area,        
-                reduction = max, 
-                verbose = True,
-                format = 'asc')
Index: /anuga_work/production/dampier_2006/locate_indigeneous.py
===================================================================
--- /anuga_work/production/dampier_2006/locate_indigeneous.py	(revision 4423)
+++ /anuga_work/production/dampier_2006/locate_indigeneous.py	(revision 4423)
@@ -0,0 +1,41 @@
+#
+# script to determine which communities are located in study region
+# 31 October 2006
+#
+
+def community_in_extent(filename,extent,zone,fid_out):
+    fid = open(filename)
+    lines = fid.readlines()
+    fid.close()
+
+    line1 = lines[0]
+    line11 = line1.split(',')
+    for i in range(len(line11)):
+        if line11[i].strip('\n').strip(' ') == 'LATITUDE': lat_index = i
+        if line11[i].strip('\n').strip(' ') == 'LONGITUDE': lon_index = i
+        if line11[i].strip('\n').strip(' ') == 'COMMUNITY': name_index = i
+
+    from anuga.coordinate_transforms.redfearn import convert_from_latlon_to_utm
+    from anuga.utilities.polygon import plot_polygons, is_inside_polygon
+    
+    for line in lines[1:]:
+        fields = line.split(',')
+        point, zone1 = convert_from_latlon_to_utm(latitudes=[fields[lat_index]],\
+                                                 longitudes=[fields[lon_index]])
+        if zone1 == zone:
+            v = is_inside_polygon(point,extent,verbose=False)
+            if v == True:
+                p = point[0]
+                s = '%s, %.2f, %.2f\n' %(fields[name_index], p[0], p[1])
+                fid_out.write(s)
+    return
+
+import project
+
+filename = project.community_filename
+filename_out = project.community_KD
+fid_out = open(filename_out, 'w')
+extent = project.poly_all
+zone = 50
+
+community_in_extent(filename,extent,zone,fid_out)
Index: /anuga_work/production/dampier_2006/make_report_cipma.py
===================================================================
--- /anuga_work/production/dampier_2006/make_report_cipma.py	(revision 4422)
+++ /anuga_work/production/dampier_2006/make_report_cipma.py	(revision 4423)
@@ -77,6 +77,7 @@
                     #'20061101_054432_run': 'big event'} # sequential
                     #'20061107_070805_run': 'Mw 9.0',
-                    '20061116_055135_run': 'Mw 9.0'} # multiple interior regions
+                    #'20061116_055135_run': 'Mw 9.0'} # multiple interior regions
                     #'20061116_062924_run': 'Mw 9.0'} # one interior region
+                    '20070426_045818_run': '1 in 10000 wave height'} # revised run with water flowing in the correct direction!
 
 is_parallel = True
@@ -84,5 +85,5 @@
     nodes = 8
 
-max_maps = {'Mw 9.0': 'mw9_map'}
+max_maps = {'1 in 10000 wave height': 'mw9_map'}
 
 gauge_map1 = 'dampier_gauges_1.jpg'
Index: /anuga_work/production/dampier_2006/project.py
===================================================================
--- /anuga_work/production/dampier_2006/project.py	(revision 4422)
+++ /anuga_work/production/dampier_2006/project.py	(revision 4423)
@@ -124,4 +124,6 @@
 gauges_dir_name_test = gauges_dir + gauge_name_test
 
+community_filename = gauges_dir + 'CHINS_v2.csv'
+community_KD = gauges_dir + 'community_KD.csv'
 
 #buildings_filename = gauges_dir + 'dampier_res_nexis.csv'
@@ -261,5 +263,5 @@
 poly_mainland = read_polygon(polygons_dir+'mainland_only.csv')
 
-# exporting asc grid - Dampier
+# exporting asc grid - Dampier gas facility
 e_min_area = 474000
 e_max_area = 480000
@@ -267,2 +269,13 @@
 n_max_area = 7725000
 
+# residential Dampier
+e_min_area_d = 468450
+e_max_area_d = 470820
+n_min_area_d = 7714050
+n_max_area_d = 7716625
+
+# residential Karratha
+e_min_area_k = 474690
+e_max_area_k = 489900
+n_min_area_k = 7704760
+n_max_area_k = 7712600
Index: /anuga_work/production/exmouth_2006/locate_indigeneous.py
===================================================================
--- /anuga_work/production/exmouth_2006/locate_indigeneous.py	(revision 4422)
+++ /anuga_work/production/exmouth_2006/locate_indigeneous.py	(revision 4423)
@@ -34,7 +34,7 @@
 
 filename = project.community_filename
-filename_out = project.community_broome
+filename_out = project.community_exmouth
 fid_out = open(filename_out, 'w')
-extent = project.polyAll
+extent = project.poly_all
 zone = 50 # or is it 49?
 
Index: /anuga_work/production/exmouth_2006/project.py
===================================================================
--- /anuga_work/production/exmouth_2006/project.py	(revision 4422)
+++ /anuga_work/production/exmouth_2006/project.py	(revision 4423)
@@ -112,4 +112,7 @@
 buildings_filename_damage_out = 'exmouth_res_nexis_modified.csv'
 
+community_filename = gaugedir + 'CHINS_v2.csv'
+community_exmouth = gaugedir + 'community_exmouth.csv'
+
 ###############################
 # Domain definitions
Index: /anuga_work/production/newcastle_2006/export_results.py
===================================================================
--- /anuga_work/production/newcastle_2006/export_results.py	(revision 4422)
+++ /anuga_work/production/newcastle_2006/export_results.py	(revision 4423)
@@ -40,5 +40,5 @@
 #time_dir = '20070331_070841' # yacaaba - c1
 #time_dir = '20070331_080603' # birubi - c2
-time_dir = '20070401_030248' # yacaaba - historical
+time_dir = '20070402_062735' # yacaaba - historical
 #time_dir = '20070331_080235' # bulli - c2
 #time_dir = '20070331_080213' # shovel - c2
Index: /anuga_work/production/onslow_2006/project.py
===================================================================
--- /anuga_work/production/onslow_2006/project.py	(revision 4422)
+++ /anuga_work/production/onslow_2006/project.py	(revision 4423)
@@ -142,8 +142,8 @@
 # work as region needs to be inside bounding box (polyAll)!!
 
-e_min_area = 240000
-e_max_area = 340000
-n_min_area = 7580000
-n_max_area = 7690000
+#e_min_area = 240000
+#e_max_area = 340000
+#n_min_area = 7580000
+#n_max_area = 7690000
 export_region = [[e_min_area, n_min_area],
                  [e_min_area, n_max_area],
Index: /anuga_work/production/pt_hedland_2006/locate_indigeneous.py
===================================================================
--- /anuga_work/production/pt_hedland_2006/locate_indigeneous.py	(revision 4423)
+++ /anuga_work/production/pt_hedland_2006/locate_indigeneous.py	(revision 4423)
@@ -0,0 +1,41 @@
+#
+# script to determine which communities are located in study region
+# 31 October 2006
+#
+
+def community_in_extent(filename,extent,zone,fid_out):
+    fid = open(filename)
+    lines = fid.readlines()
+    fid.close()
+
+    line1 = lines[0]
+    line11 = line1.split(',')
+    for i in range(len(line11)):
+        if line11[i].strip('\n').strip(' ') == 'LATITUDE': lat_index = i
+        if line11[i].strip('\n').strip(' ') == 'LONGITUDE': lon_index = i
+        if line11[i].strip('\n').strip(' ') == 'COMMUNITY': name_index = i
+
+    from anuga.coordinate_transforms.redfearn import convert_from_latlon_to_utm
+    from anuga.utilities.polygon import plot_polygons, is_inside_polygon
+    
+    for line in lines[1:]:
+        fields = line.split(',')
+        point, zone1 = convert_from_latlon_to_utm(latitudes=[fields[lat_index]],\
+                                                 longitudes=[fields[lon_index]])
+        if zone1 == zone:
+            v = is_inside_polygon(point,extent,verbose=False)
+            if v == True:
+                p = point[0]
+                s = '%s, %.2f, %.2f\n' %(fields[name_index], p[0], p[1])
+                fid_out.write(s)
+    return
+
+import project
+
+filename = project.community_filename
+filename_out = project.community_pt_hedland
+fid_out = open(filename_out, 'w')
+extent = project.polyAll
+zone = 50
+
+community_in_extent(filename,extent,zone,fid_out)
Index: /anuga_work/production/pt_hedland_2006/project.py
===================================================================
--- /anuga_work/production/pt_hedland_2006/project.py	(revision 4422)
+++ /anuga_work/production/pt_hedland_2006/project.py	(revision 4423)
@@ -194,4 +194,7 @@
 outputname = outputtimedir + basename  #Used by post processing
 
+community_filename = gaugedir + 'CHINS_v2.csv'
+community_pt_hedland = gaugedir + 'community_pt_hedland.csv'
+
 # clipping region to make DEM (pts file) from onshore data
 eastingmin = 594000
Index: /anuga_work/production/sydney_2006/run_sydney_slide.py
===================================================================
--- /anuga_work/production/sydney_2006/run_sydney_slide.py	(revision 4422)
+++ /anuga_work/production/sydney_2006/run_sydney_slide.py	(revision 4423)
@@ -28,4 +28,5 @@
 from anuga.geospatial_data.geospatial_data import *
 from anuga.abstract_2d_finite_volumes.util import start_screen_catcher, copy_code_files
+from anuga_parallel.parallel_api import distribute, numprocs, myid, barrier
 
 # Application specific imports
@@ -38,8 +39,9 @@
 
 # creates copy of code in output dir 
-copy_code_files(project_slide.outputtimedir,__file__,dirname(project_slide.__file__)+sep+ project_slide.__name__+'.py' )
+#copy_code_files(project_slide.outputtimedir,__file__,dirname(project_slide.__file__)+sep+ project_slide.__name__+'.py' )
 myid = 0
 numprocs = 1
-start_screen_catcher(project_slide.outputtimedir, myid, numprocs)
+#start_screen_catcher(project_slide.outputtimedir, myid, numprocs)
+#barrier()
 
 print 'USER:    ', project_slide.user
@@ -56,5 +58,5 @@
 nsw_dem_name = project_slide.nsw_dem_name
 meshname = project_slide.meshname+'.msh'
-
+'''
 # creates DEM from asc data
 convert_dem_from_ascii2netcdf(on_offshore25_dem_name, use_cache=True, verbose=True)
@@ -105,5 +107,5 @@
 G.export_points_file(project_slide.combined_dem_name + '.pts')
 #G.export_points_file(project_slide.combined_dem_name + '.xya')
-
+'''
 #----------------------------------------------------------------------------
 # Create the triangular mesh based on overall clipping polygon with a tagged
