Index: anuga_work/development/convergence_okushiri_2008/README.txt
===================================================================
--- anuga_work/development/convergence_okushiri_2008/README.txt	(revision 5604)
+++ anuga_work/development/convergence_okushiri_2008/README.txt	(revision 5720)
@@ -6,6 +6,7 @@
 the Third International Conference on Long Wave Runup:
 http://www.cee.cornell.edu/longwave/index.cfm?page=benchmark&problem=2. 
-Once this up-scaling has been completed and verified, then the files will be used for conducting
-a convergence study in ANUGA. This component is still in development.
+
+The "up-scaled" files are then used for conducting a convergence study 
+in ANUGA.
 
 Data files available in this directory are
@@ -40,5 +41,14 @@
   together with the experimental data provided. Numerical similarity 
   measures will also be computed.
- 
+  
+get_timeseries.py
+  This script extracts timeseries from the sww file and writes them to individual
+  csv files for each gauge location.
+
+export_results.py
+  This script extracts a number of variables from the sww file (for eg stage, 
+  depth, momentum) in three regions at three different but fixed regular grid
+  resolutions (at either discrete time indices or maximised over the whole 
+  simulation).
 
 Methodology for true-scale transformation:
Index: anuga_work/development/convergence_okushiri_2008/export_results.py
===================================================================
--- anuga_work/development/convergence_okushiri_2008/export_results.py	(revision 5604)
+++ anuga_work/development/convergence_okushiri_2008/export_results.py	(revision 5720)
@@ -1,6 +1,8 @@
 import project_truescale, os
 import sys
+import time
 from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts
 from anuga.shallow_water.data_manager import sww2dem
+from anuga.geospatial_data.geospatial_data import *
 from os import sep
 
@@ -15,98 +17,114 @@
 res_dir9 = '20080715_015727_run_1-32_contour_polygons_lfountai'
 res_dir10 = '20080721_015521_run_1-64_contour_polygons_lfountai'
-res_dirs = [#res_dir1, res_dir2, res_dir3, res_dir4, res_dir5, res_dir6, res_dir7, res_dir8,
-            res_dir9, res_dir10]
+res_dirs = [res_dir1, #res_dir2, res_dir3, res_dir4, res_dir5, res_dir6, res_dir7, res_dir8,res_dir9,
+            res_dir10]
+#timesteps = [200, 250, 300, 350, 400, 450]
+timesteps = [327] #this is time of maximum inundation
+
 
 for res_dir in res_dirs:
     
-    #timestep = 0
-    directory = project_truescale.output_dir+res_dir+sep
-    name = directory+'okushiri_truescale'
+    for timestep in timesteps:
+                
+        directory = project_truescale.output_dir+res_dir+sep
+        name = directory+'okushiri_truescale'
 
-    is_parallel = False
-    #is_parallel = True
+        is_parallel = False
+        #is_parallel = True
 
-    if is_parallel == True: nodes = 10
-    print 'output directory:', directory
+        if is_parallel == True: nodes = 10
+        print 'output directory:', directory
 
-    area = ['Deep', 'Mid', 'Shallow']
+        area = ['Deep', 'Mid', 'Shallow']
+            
+        for which_area in area:
+            if which_area == 'Deep':
+                cellsize = 50
+                easting_min = project_truescale.xminDeep
+                easting_max = project_truescale.xmaxDeep
+                northing_min = project_truescale.yminDeep
+                northing_max = project_truescale.ymaxDeep
 
-    for which_area in area:
-        if which_area == 'Deep':
-            cellsize = 50
-            easting_min = project_truescale.xminDeep
-            easting_max = project_truescale.xmaxDeep
-            northing_min = project_truescale.yminDeep
-            northing_max = project_truescale.ymaxDeep
+            if which_area == 'Mid':
+                cellsize = 25
+                easting_min = project_truescale.xminMid
+                easting_max = project_truescale.xmaxMid
+                northing_min = project_truescale.yminMid
+                northing_max = project_truescale.ymaxMid
 
-        if which_area == 'Mid':
-            cellsize = 25
-            easting_min = project_truescale.xminMid
-            easting_max = project_truescale.xmaxMid
-            northing_min = project_truescale.yminMid
-            northing_max = project_truescale.ymaxMid
+            if which_area == 'Shallow':
+                cellsize = 10
+                easting_min = project_truescale.xminShallow
+                easting_max = project_truescale.xmaxShallow
+                northing_min = project_truescale.yminShallow
+                northing_max = project_truescale.ymaxShallow
 
-        if which_area == 'Shallow':
-            cellsize = 10
-            easting_min = project_truescale.xminShallow
-            easting_max = project_truescale.xmaxShallow
-            northing_min = project_truescale.yminShallow
-            northing_max = project_truescale.ymaxShallow
+    ##    which_area='all'
+    ##    easting_min=0
+    ##    easting_max=2179.2
+    ##    northing_min=0
+    ##    northing_max=1360.8
+    ##    cellsize=10
+        
+           
+            var = [2]
+                
+            for which_var in var:
+                if which_var == 0:  # Stage
+                    outname = directory + which_area + '_stage_' + str(timestep)
+                    quantityname = 'stage'
+
+                if which_var == 1:  # Absolute Momentum
+                    outname = directory + which_area + '_momentum_' + str(timestep)
+                    quantityname = '(xmomentum**2 + ymomentum**2)**0.5'  
+
+                if which_var == 2:  # Depth
+                    outname = directory + which_area + '_depth_' + str(timestep)
+                    quantityname = 'stage-elevation'  
+
+                if which_var == 3:  # Speed
+                    outname = directory + which_area + '_speed_' + str(timestep)
+                    quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))'  #Speed
+
+                if which_var == 4:  # Elevation
+                    outname = directory + which_area + '_elevation_' + str(timestep)
+                    quantityname = '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,
+    ##                                quantity = quantityname,
+    ##                                timestep = timestep,
+    ##                                cellsize = cellsize,      
+    ##                                easting_min = project_grad.e_min_area,
+    ##                                easting_max = project_grad.e_max_area,
+    ##                                northing_min = project_grad.n_min_area,
+    ##                                northing_max = project_grad.n_max_area,        
+    ##                                reduction = max, 
+    ##                                verbose = True,
+    ##                                format = 'asc')
+    ##            else:
+
+                
+                print 'start sww2dem', which_area
+                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 = 'ers')
 
 
-       # var = [2,3,4] # depth and speed
-    #var = [2] # depth
-        var = [0,4]
-
-        for which_var in var:
-            if which_var == 0:  # Stage
-                outname = directory + which_area + '_stage' 
-                quantityname = 'stage'
-
-            if which_var == 1:  # Absolute Momentum
-                outname = directory + which_area + '_momentum' 
-                quantityname = '(xmomentum**2 + ymomentum**2)**0.5'  
-
-            if which_var == 2:  # Depth
-                outname = directory + which_area + '_depth'
-                quantityname = 'stage-elevation'  
-
-            if which_var == 3:  # Speed
-                outname = directory + which_area + '_speed'
-                quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))'  #Speed
-
-            if which_var == 4:  # Elevation
-                outname = directory + which_area + '_elevation'
-                quantityname = '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,
-##                                quantity = quantityname,
-##                                timestep = timestep,
-##                                cellsize = cellsize,      
-##                                easting_min = project_grad.e_min_area,
-##                                easting_max = project_grad.e_max_area,
-##                                northing_min = project_grad.n_min_area,
-##                                northing_max = project_grad.n_max_area,        
-##                                reduction = max, 
-##                                verbose = True,
-##                                format = 'asc')
-##            else:
-            print 'start sww2dem', which_area
-            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 = 'ers')
-
+##convert_dem_from_ascii2netcdf(outname, use_cache=True, verbose=True)
+##dem2pts(outname, use_cache=True, verbose=True)
+##G = Geospatial_data(file_name = outname + '.pts')
+##G.export_points_file('test' + '.txt') 
Index: anuga_work/development/convergence_okushiri_2008/get_timeseries.py
===================================================================
--- anuga_work/development/convergence_okushiri_2008/get_timeseries.py	(revision 5604)
+++ anuga_work/development/convergence_okushiri_2008/get_timeseries.py	(revision 5720)
@@ -16,5 +16,20 @@
 
 #timestamp='20080617_001810_run_leharne'
-timestamp='20080617_041810_run_original_no_int_polygons_lfountai'
+#timestamp='20080617_041810_run_original_no_int_polygons_lfountai'
+#timestamp='20080617_040837_run_half_lfountai'
+#timestamp='20080617_041356_run_double_lfountai'
+#timestamp='20080708_064714_run_original_contour_polygons_lfountai'
+#timestamp='20080708_064815_run_half_contour_polygons_lfountai'
+#timestamp='20080708_064841_run_double_contour_polygons_lfountai'
+#timestamp='20080714_231759_run_quarter_contour_polygons_lfountai'
+#timestamp='20080714_234934_run_eighth_contour_polygons_lfountai'
+#timestamp='20080714_235634_run_sixteenth_contour_polygons_lfountai'
+#timestamp='20080715_015727_run_1-32_contour_polygons_lfountai'
+#timestamp='20080715_023223_run_quadruple_contour_polygons_lfountai'
+#timestamp='20080721_015521_run_1-64_contour_polygons_lfountai'
+#timestamp='20080725_051221_run_octuple_contour_polygons_lfountai'
+timestamp='20080725_022934_run_1.5_contour_polygons_lfountai'
+
+
 filename=project_truescale.output_dir+timestamp+sep+project_truescale.output_filename
 
Index: anuga_work/development/convergence_okushiri_2008/project_truescale.py
===================================================================
--- anuga_work/development/convergence_okushiri_2008/project_truescale.py	(revision 5604)
+++ anuga_work/development/convergence_okushiri_2008/project_truescale.py	(revision 5720)
@@ -1,4 +1,4 @@
-"""Common filenames for truescale Okushiri Island convergence study
-Formats are given as ANUGA native netCDF where applicable.
+"""Common filenames and run parameters for truescale Okushiri Island
+convergence study. Formats are given as ANUGA native netCDF where applicable.
 
 """
@@ -200,20 +200,20 @@
 
 xminDeep = 0
-xmaxDeep = 1000
+xmaxDeep = 950
 yminDeep = 0
-ymaxDeep = 1360.8
+ymaxDeep = 1400
 
 xminMid = 1000
 xmaxMid = 1700
 yminMid = 0
-ymaxMid = 1360.8
-
-xminShallow = 1700
-xmaxShallow = 2179.2
+ymaxMid = 1400
+
+xminShallow = 1725
+xmaxShallow = 2175
 yminShallow = 0
-ymaxShallow = 1360.8
-
-
-
-
-
+ymaxShallow = 1400
+
+
+
+
+
Index: anuga_work/development/convergence_okushiri_2008/run_okushiri_truescale.py
===================================================================
--- anuga_work/development/convergence_okushiri_2008/run_okushiri_truescale.py	(revision 5604)
+++ anuga_work/development/convergence_okushiri_2008/run_okushiri_truescale.py	(revision 5720)
@@ -13,5 +13,7 @@
 
 This version up-scales the original 1:400 scale wave-tank experiment, to
-"true-scale" with mesh defined using interior polygons.
+"true-scale" with mesh defined using interior polygons. The resolution is then
+varied by a factor of 2 to investigate convergence behaviour (refer to script
+project_truescale.py for details).
 
 The original validation data is available at
@@ -61,5 +63,5 @@
                          boundary_tags={'wall': [0, 1, 3],'wave': [2]},
                          maximum_triangle_area=project_truescale.res_poly_all,
-                         #interior_regions=project_truescale.interior_regions,
+                         interior_regions=project_truescale.interior_regions, # comment out when not using interior polygon definitions
                          filename=project_truescale.mesh_name+'.msh',
                          verbose=True)
@@ -74,5 +76,5 @@
 
 # Write vertex coordinates to file
-filename=project.vertex_filename
+filename=project_truescale.vertex_filename
 fid=open(filename,'w')
 fid.write('x (m), y (m)\n')
