Index: production/sydney_2006/project.py
===================================================================
--- production/sydney_2006/project.py	(revision 2403)
+++ production/sydney_2006/project.py	(revision 2407)
@@ -3,7 +3,13 @@
 """
 
-from os import sep
+from os import sep, environ
 from os.path import expanduser
+from utilities.polygon import read_polygon
 import sys
+
+from pmesh.create_mesh import convert_points_from_latlon_to_utm
+                
+
+
 
 #Making assumptions about the location of scenario data
@@ -14,4 +20,6 @@
 finename = 'bathy_dem25' # get from Neil/Ingo (DEM or topo data) Wed 25 Jan
 
+
+
 # creating easting and northing max and min for fine data - region of interest
 eastingmin = 332090
@@ -29,7 +37,8 @@
 
 if sys.platform == 'win32':
-    home = '..\..\..\..\..'     #Sandpit's parent dir
+    home = environ['INUNDATIONHOME']     #Sandpit's parent dir
 else:    
     home = expanduser('~')
+    
 
 
@@ -38,4 +47,5 @@
 datadir = home+sep+scenario_dir_name+sep+'topographies'+sep
 outputdir = home+sep+scenario_dir_name+sep+'output'+sep
+polygondir = home+sep+scenario_dir_name+sep+'polygons'+sep
 
 meshname = meshdir + basename
@@ -44,4 +54,10 @@
 combineddemname = datadir + 'sydneytopo'
 outputname = outputdir + basename  #Used by post processing
+
+#csv file of coastline 50m epsilon belt
+manly_polygonname = polygondir + 'manly_polygon_UTM56_coarse' 
+manly_polygon = read_polygon(manly_polygonname + '.csv')
+#print manly_polygon
+
 gauge_filename = outputdir + 'sydney_gauges.xya'
 gauge_outname = outputdir + 'gauges_max_output.xya'
@@ -51,4 +67,18 @@
 
 # define clipping polygon
+south = degminsec2decimal_degrees(-34,05,0)
+north = degminsec2decimal_degrees(-33,33,0)
+west = degminsec2decimal_degrees(151,1,0)
+east = degminsec2decimal_degrees(151,30,0)
+p0 = [south, west]
+p1 = [south, east]
+p2 = [north, east]
+p3 = [north, west]
+    
+polygonall, zone = convert_points_from_latlon_to_utm([p0, p1, p2, p3])
+refzone = zone
+
+print 'Got refzone', refzone
+
 dsouth = degminsec2decimal_degrees(-34,05,0)
 dnorth = degminsec2decimal_degrees(-33,33,0)
@@ -72,6 +102,11 @@
 dp8 = [dnorth, dwest]
     
-diffpolygonall = [dp0, dp1, dp2, dp3, dp4, dp5, dp6, dp7]
-
+diffpolygonall, zone = convert_points_from_latlon_to_utm([dp0, dp1, dp2, dp3, dp4, dp5, dp6, dp7])
+# to put chunk back in
+#diffpolygonall = [dp0, dp1, dp2, dp3, dp4, dp8]
+
+
+
+#Interior regions - the Harbour - take 2
 #Interior regions - the Harbour
 harbour_1x = degminsec2decimal_degrees(-33,51,0)
@@ -122,7 +157,11 @@
 k142 = [harbour_15x, harbour_15y]
 
-harbour_polygon_2 = [k02, k112, k122, k12, k22, k62, k72, k82, k102, k42, k52] #worked
+harbour_polygon_2, zone = convert_points_from_latlon_to_utm([k02, k112, k122, k12, k22, k62, k72, k82, k102, k42, k52]) #worked
+assert zone == refzone
+
 
 #Interior region - Botany Bay
+
+#Interior region - Botany Bay - take 2
 bb_1x = degminsec2decimal_degrees(-34,3,0)
 bb_1y = degminsec2decimal_degrees(151,2,30)
@@ -157,7 +196,76 @@
 j92 = [bb_10x, bb_10y]
 
-botanybay_polygon_2 = [j92, j12, j22, j62, j82, j72, j42] # worked
-
-# around 42km across from harbour(385000,6255000) 
+botanybay_polygon_2, zone = convert_points_from_latlon_to_utm([j92, j12, j22, j62, j82, j72, j42]) # worked
+
+
+# close to botany bay opening (340000,6236000)
+# x0 = 25964
+# y0 = 11049
+# around 10km from botany bay opening (350000,6236000)
+# x0 = 35964
+# y0 = 11049
+# around 21km from botany bay opening (361000,6236000)
+#x0 = 46964
+#y0 = 11049
+
+# not used for sydney scenario, original interior regions listed though
+# setting up problem area for doing just around the harbour
+hsouth = degminsec2decimal_degrees(-33,54,0)
+hnorth = degminsec2decimal_degrees(-33,48,0)
+hwest = degminsec2decimal_degrees(151,0,0)
+heast = degminsec2decimal_degrees(151,30,0)
+
+hp0 = [hsouth, hwest]
+hp1 = [hsouth, heast]
+hp2 = [hnorth, heast]
+hp3 = [hnorth, hwest]
+polygon_h, zone = convert_points_from_latlon_to_utm([hp0, hp1, hp2, hp3])
+
+#Interior regions - the Harbour - take 1
+harbour_south = degminsec2decimal_degrees(-33,53,0)
+harbour_north = degminsec2decimal_degrees(-33,47,0)
+harbour_west = degminsec2decimal_degrees(151,5,0)
+harbour_east = degminsec2decimal_degrees(151,19,0)
+
+#harbour_south1 = degminsec2decimal_degrees(-33,53,0)
+#harbour_south2 = degminsec2decimal_degrees(-33,52,0)
+#harbour_north1 = degminsec2decimal_degrees(-33,45,0)
+#harbour_north2 = degminsec2decimal_degrees(-33,48,0)
+#harbour_west = degminsec2decimal_degrees(151,5,0)
+#harbour_east = degminsec2decimal_degrees(151,19,0)
+
+k0 = [harbour_south, harbour_west]
+k1 = [harbour_south, harbour_east]
+k2 = [harbour_north, harbour_east]
+k3 = [harbour_north, harbour_west]    
+
+harbour_polygon, zone = convert_points_from_latlon_to_utm([k0, k1, k2, k3])
+
+# setting up problem area for doing just around Botany Bay
+bsouth = degminsec2decimal_degrees(-33,56,0)
+bnorth = degminsec2decimal_degrees(-34,3,0)
+bwest = degminsec2decimal_degrees(151,0,0)
+beast = degminsec2decimal_degrees(151,30,0)
+
+bp0 = [bsouth, bwest]
+bp1 = [bsouth, beast]
+bp2 = [bnorth, beast]
+bp3 = [bnorth, bwest]
+polygon_bb, zone = convert_points_from_latlon_to_utm([bp0, bp1, bp2, bp3])
+
+#Interior region - Botany Bay - take 1
+botanybay_south = degminsec2decimal_degrees(-33,58,0)
+botanybay_north = degminsec2decimal_degrees(-34,1,0)
+botanybay_west = degminsec2decimal_degrees(151,5,0)
+botanybay_east = degminsec2decimal_degrees(151,18,0)
+
+j0 = [botanybay_south, botanybay_west]
+j1 = [botanybay_south, botanybay_east]
+j2 = [botanybay_north, botanybay_east]
+j3 = [botanybay_north, botanybay_west]    
+
+botanybay_polygon, zone = convert_points_from_latlon_to_utm([j0, j1, j2, j3])
+assert zone == refzone
+
 #x0 = 28964 + 42000 
 #y0 = 30049 
