Index: /inundation/pyvolution/view_tsh.py
===================================================================
--- /inundation/pyvolution/view_tsh.py (revision 2621)
+++ /inundation/pyvolution/view_tsh.py (revision 2622)
@@ -9,5 +9,6 @@
from shallow_water import Domain
from pmesh2domain import pmesh_to_domain_instance
-from util import file_function, Polygon_function, read_polygon
+from pyvolution.util import file_function
+from utilities.polygon import Polygon_function, read_polygon
from Numeric import zeros, Float, maximum, minimum
from realtime_visualisation_new import *
Index: /inundation/utilities/polygon.py
===================================================================
--- /inundation/utilities/polygon.py (revision 2621)
+++ /inundation/utilities/polygon.py (revision 2622)
@@ -10,5 +10,5 @@
print 'Could not find scipy - using Numeric'
from Numeric import Float, Int, zeros, ones, array, concatenate, reshape, dot
-
+
from math import sqrt
@@ -45,14 +45,14 @@
def inside_polygon(points, polygon, closed = True, verbose = False):
"""Determine points inside a polygon
-
+
Functions inside_polygon and outside_polygon have been defined in
- terms af separate_by_polygon which will put all inside indices in
+ terms af separate_by_polygon which will put all inside indices in
the first part of the indices array and outside indices in the last
-
- See separate_points_by_polygon for documentation
+
+ See separate_points_by_polygon for documentation
"""
if verbose: print 'Checking input to inside_polygon'
-
+
try:
points = ensure_numeric(points, Float)
@@ -66,5 +66,5 @@
polygon = ensure_numeric(polygon, Float)
except NameError, e:
- raise NameError, e
+ raise NameError, e
except:
msg = 'Polygon %s could not be converted to Numeric array' %(str(polygon))
@@ -90,10 +90,10 @@
def outside_polygon(points, polygon, closed = True, verbose = False):
"""Determine points outside a polygon
-
+
Functions inside_polygon and outside_polygon have been defined in
- terms af separate_by_polygon which will put all inside indices in
+ terms af separate_by_polygon which will put all inside indices in
the first part of the indices array and outside indices in the last
-
- See separate_points_by_polygon for documentation
+
+ See separate_points_by_polygon for documentation
"""
@@ -102,5 +102,5 @@
points = ensure_numeric(points, Float)
except NameError, e:
- raise NameError, e
+ raise NameError, e
except:
msg = 'Points could not be converted to Numeric array'
@@ -110,5 +110,5 @@
polygon = ensure_numeric(polygon, Float)
except NameError, e:
- raise NameError, e
+ raise NameError, e
except:
msg = 'Polygon could not be converted to Numeric array'
@@ -133,5 +133,5 @@
# No points are outside
return []
- else:
+ else:
return indices[count:][::-1] #return reversed
@@ -180,9 +180,9 @@
#Input checks
-
+
try:
points = ensure_numeric(points, Float)
except NameError, e:
- raise NameError, e
+ raise NameError, e
except:
msg = 'Points could not be converted to Numeric array'
@@ -192,5 +192,5 @@
polygon = ensure_numeric(polygon, Float)
except NameError, e:
- raise NameError, e
+ raise NameError, e
except:
msg = 'Polygon could not be converted to Numeric array'
@@ -276,15 +276,15 @@
if verbose: print 'Checking input to separate_points_by_polygon'
-
+
#Input checks
assert isinstance(closed, bool), 'Keyword argument "closed" must be boolean'
- assert isinstance(verbose, bool), 'Keyword argument "verbose" must be boolean'
-
-
+ assert isinstance(verbose, bool), 'Keyword argument "verbose" must be boolean'
+
+
try:
points = ensure_numeric(points, Float)
except NameError, e:
- raise NameError, e
+ raise NameError, e
except:
msg = 'Points could not be converted to Numeric array'
@@ -295,5 +295,5 @@
polygon = ensure_numeric(polygon, Float)
except NameError, e:
- raise NameError, e
+ raise NameError, e
except:
msg = 'Polygon could not be converted to Numeric array'
@@ -391,7 +391,7 @@
#Make points in polygons relative to geo_reference
- self.regions = []
+ self.regions = []
for polygon, value in regions:
- P = geo_reference.change_points_geo_ref(polygon)
+ P = geo_reference.change_points_geo_ref(polygon)
self.regions.append( (P, value) )
@@ -429,5 +429,5 @@
return z
-def read_polygon(filename):
+def read_polygon(filename,split=','):
"""Read points assumed to form a polygon.
There must be exactly two numbers in each line separated by a comma.
@@ -441,5 +441,5 @@
polygon = []
for line in lines:
- fields = line.split(',')
+ fields = line.split(split)
polygon.append( [float(fields[0]), float(fields[1])] )
@@ -453,5 +453,5 @@
number_of_points - (optional) number of points
seed - seed for random number generator (default=None)
- exclude - list of polygons (inside main polygon) from where points should be excluded
+ exclude - list of polygons (inside main polygon) from where points should be excluded
Output:
@@ -489,5 +489,5 @@
append = True
-
+
#Check exclusions
if exclude is not None:
@@ -495,8 +495,8 @@
if inside_polygon( [x,y], ex_poly ):
append = False
-
-
- if append is True:
- points.append([x,y])
+
+
+ if append is True:
+ points.append([x,y])
return points
@@ -530,18 +530,18 @@
else:
x_delta = x+x_mult*x*delta
-
+
if y == 0:
y_delta = y_mult*delta
else:
y_delta = y+y_mult*y*delta
-
+
point = [x_delta, y_delta]
#print "point",point
if inside_polygon( point, polygon, closed = False ):
raise Found
- except Found:
+ except Found:
point_in = True
else:
- delta = delta*0.1
+ delta = delta*0.1
return point
Index: /inundation/zeus/Merimbula.zpi
===================================================================
--- /inundation/zeus/Merimbula.zpi (revision 2621)
+++ /inundation/zeus/Merimbula.zpi (revision 2622)
@@ -73,12 +73,10 @@
Off
Off
- ..\merimbula\prepare.py
- ..\merimbula\project.py
- ..\merimbula\run_cairns.py
- ..\merimbula\run_least_squares_merimbula.py
- ..\merimbula\run_merimbula_lake.py
- ..\merimbula\run_merimbula_lake_checkpoint.py
- ..\merimbula\run_new_meribula.py
- ..\merimbula\view_sww.py
+ ..\..\production\merimbula_2005\prepare.py
+ ..\..\production\merimbula_2005\project.py
+ ..\..\production\merimbula_2005\run_merimbula_lake.py
+ ..\..\production\merimbula_2005\run_merimbula_lake_weed.py
+ ..\..\production\merimbula_2005\run_new_meribula.py
+ ..\..\production\merimbula_2005\run_new_meribula_weed.py
Index: /inundation/zeus/anuga-workspace.zwi
===================================================================
--- /inundation/zeus/anuga-workspace.zwi (revision 2621)
+++ /inundation/zeus/anuga-workspace.zwi (revision 2622)
@@ -2,5 +2,5 @@
Debug
- pyvolution
+ Merimbula
analytic_solutions.zpi
euler.zpi
Index: /inundation/zeus/pyvolution.zpi
===================================================================
--- /inundation/zeus/pyvolution.zpi (revision 2621)
+++ /inundation/zeus/pyvolution.zpi (revision 2622)
@@ -76,5 +76,4 @@
..\pyvolution\bed_w_eden_boundary.py
..\pyvolution\bed_w_file_boundary.py
- ..\pyvolution\cg_solve.py
..\pyvolution\check_sww_tsh.py
..\pyvolution\combine_pts.py
@@ -90,5 +89,4 @@
..\pyvolution\island.py
..\pyvolution\least_squares.py
- ..\pyvolution\load_mesh\loadASCII.py
..\pyvolution\log.ini
..\pyvolution\mesh.py
@@ -112,9 +110,6 @@
..\pyvolution\shallow_water_vtk.py
..\pyvolution\show_balanced_limiters.py
- ..\pyvolution\sparse.py
- ..\pyvolution\sparse_ext.c
..\pyvolution\test_advection.py
..\pyvolution\test_all.py
- ..\pyvolution\test_cg_solve.py
..\pyvolution\test_combine_pts.py
..\pyvolution\test_data_manager.py
@@ -131,5 +126,4 @@
..\pyvolution\test_region.py
..\pyvolution\test_shallow_water.py
- ..\pyvolution\test_sparse.py
..\pyvolution\test_util.py
..\pyvolution\treenode.py
@@ -137,6 +131,4 @@
..\pyvolution\twolevels.py
..\pyvolution\util.py
- ..\pyvolution\util_ext.c
- ..\pyvolution\util_ext.h
..\pyvolution\view_tsh.py
..\pyvolution\vtk_realtime_visualiser.py
Index: /production/merimbula_2005/prepare.py
===================================================================
--- /production/merimbula_2005/prepare.py (revision 2621)
+++ /production/merimbula_2005/prepare.py (revision 2622)
@@ -1,11 +1,11 @@
-def prepare_timeboundary(filename):
- """Converting tide time series to NetCDF tms file.
+def prepare_wind_stress(filename):
+ """Converting wind timeseries to NetCDF tms file.
This is a 'throw-away' code taylor made for files like
'Benchmark_2_input.txt' from the LWRU2 benchmark
"""
- print 'Preparing time boundary from %s' %filename
+ print 'Preparing wind timeseries %s' %filename
from Numeric import array, zeros, Float, asarray
@@ -13,5 +13,5 @@
#Skip first line
- line = fid.readline()
+ #line = fid.readline()
#Read remaining lines
@@ -22,9 +22,11 @@
N = len(lines)
T = zeros(N, Float) #Time
- Q = zeros(N, Float) #Values
+ S = zeros(N, Float) #Speed
+ B = zeros(N, Float) #Bearing
Told = 0.0
Sold = ' '
Lold = ' '
+
for i, line in enumerate(lines):
fields = line.split()
@@ -46,7 +48,7 @@
T[i] = T[i] - Tstart
#this is specific to this data set. deals with daylight saving
- if i>3270:
- T[i] = T[i]+3600
-
+# if i>3270:
+# T[i] = T[i]+3600
+#
if T[i]3270:
+ T[i] = T[i]+3600
+
+ if T[i]