Index: /trunk/anuga_core/source/anuga/file_conversion/test_csv2sts.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/test_csv2sts.py	(revision 8818)
+++ /trunk/anuga_core/source/anuga/file_conversion/test_csv2sts.py	(revision 8819)
@@ -90,5 +90,5 @@
     def _check_generated_sts(self):
         """ check that we can read data out of the file """
-        sts = NetCDFFile(sts_out)
+        sts = NetCDFFile(sts_out,'r')
         
         data, names = load_csv_as_dict(testfile_csv, delimiter=' ', d_type = num.float64)
Index: /trunk/anuga_core/source/anuga/geometry/polygon.py
===================================================================
--- /trunk/anuga_core/source/anuga/geometry/polygon.py	(revision 8818)
+++ /trunk/anuga_core/source/anuga/geometry/polygon.py	(revision 8819)
@@ -723,5 +723,5 @@
     """
 
-    from pylab import ion, hold, plot, savefig, xlabel, \
+    from pylab import ion, ioff, hold, plot, savefig, xlabel, \
                       ylabel, title, close, title, fill
 
@@ -777,4 +777,6 @@
         savefig('test_image')
 
+    ioff()
+    hold(False)
     close('all')
 
Index: /trunk/anuga_core/source/anuga/geometry/test_polygon.py
===================================================================
--- /trunk/anuga_core/source/anuga/geometry/test_polygon.py	(revision 8818)
+++ /trunk/anuga_core/source/anuga/geometry/test_polygon.py	(revision 8819)
@@ -1781,7 +1781,12 @@
         plot_polygons([polygon1, polygon2], figname='test1')
 
+        import pylab
+        pylab.close('all')
+
         # Another case
         polygon3 = [[1,5], [10,1], [100,10], [50,10], [3,6]]
         plot_polygons([polygon2, polygon3], figname='test2')
+
+        pylab.close('all')
 
         for file in ['test1.png', 'test2.png']:
Index: /trunk/anuga_core/source/anuga/geospatial_data/geospatial_data.py
===================================================================
--- /trunk/anuga_core/source/anuga/geospatial_data/geospatial_data.py	(revision 8818)
+++ /trunk/anuga_core/source/anuga/geospatial_data/geospatial_data.py	(revision 8819)
@@ -877,5 +877,5 @@
     fid = NetCDFFile(file_name, netcdf_mode_r)
 
-    pointlist = num.array(fid.variables['points'])
+    pointlist = fid.variables['points'][:]
     keys = fid.variables.keys()
 
@@ -893,5 +893,6 @@
         if verbose: log.critical("Geospatial_data: Reading attribute '%s'" % key)
 
-        attributes[key] = num.array(fid.variables[key])
+        if not (key == 'points'):
+            attributes[key] = fid.variables[key][:]
 
     try:
Index: /trunk/anuga_core/source/anuga/shallow_water/sww_interrogate.py
===================================================================
--- /trunk/anuga_core/source/anuga/shallow_water/sww_interrogate.py	(revision 8818)
+++ /trunk/anuga_core/source/anuga/shallow_water/sww_interrogate.py	(revision 8819)
@@ -407,6 +407,10 @@
             msg += 'must does not match model time interval: [%.8f, %.8f]\n' \
                    % (time[0], time[-1])
-            if time_interval[1] < time[0]: raise ValueError(msg)
-            if time_interval[0] > time[-1]: raise ValueError(msg)
+            if time_interval[1] < time[0]:
+                fid.close()
+                raise ValueError(msg)
+            if time_interval[0] > time[-1]:
+                fid.close()
+                raise ValueError(msg)
 
             # Take time indices corresponding to interval (& is bitwise AND)
Index: /trunk/anuga_core/source/anuga/shallow_water/test_sww_interrogate.py
===================================================================
--- /trunk/anuga_core/source/anuga/shallow_water/test_sww_interrogate.py	(revision 8818)
+++ /trunk/anuga_core/source/anuga/shallow_water/test_sww_interrogate.py	(revision 8819)
@@ -54,5 +54,6 @@
         domain.set_minimum_storable_height(0.01)
 
-        domain.set_name('runuptest')
+        filename = 'runup_test_3'
+        domain.set_name(filename)
         swwfile = domain.get_name() + '.sww'
 
@@ -527,4 +528,6 @@
         final_runup_height = -0.3
 
+        filename = 'runup_test_1'
+
         #--------------------------------------------------------------
         # Setup computational domain
@@ -533,5 +536,5 @@
         points, vertices, boundary = rectangular_cross(N, N)
         domain = Domain(points, vertices, boundary)
-        domain.set_name('runup_test')
+        domain.set_name(filename)
         domain.set_maximum_allowed_speed(1.0)
 
@@ -582,9 +585,9 @@
         #--------------------------------------------------------------
         q_ref = domain.get_maximum_inundation_elevation()
-        q = get_maximum_inundation_elevation('runup_test.sww')
+        q = get_maximum_inundation_elevation(filename+'.sww')
         msg = 'We got %f, should have been %f' % (q, q_ref)
         assert num.allclose(q, q_ref, rtol=1.0/N), msg
 
-        q = get_maximum_inundation_elevation('runup_test.sww')
+        q = get_maximum_inundation_elevation(filename+'.sww')
         msg = 'We got %f, should have been %f' % (q, initial_runup_height)
         assert num.allclose(q, initial_runup_height, rtol = 1.0/N), msg
@@ -592,5 +595,5 @@
         # Test error condition if time interval is out
         try:
-            q = get_maximum_inundation_elevation('runup_test.sww',
+            q = get_maximum_inundation_elevation(filename+'.sww',
                                                  time_interval=[2.0, 3.0])
         except ValueError:
@@ -601,5 +604,5 @@
 
         # Check correct time interval
-        q, loc = get_maximum_inundation_data('runup_test.sww',
+        q, loc = get_maximum_inundation_data(filename+'.sww',
                                              time_interval=[0.0, 3.0])
         msg = 'We got %f, should have been %f' % (q, initial_runup_height)
@@ -635,5 +638,5 @@
         assert num.allclose(q, final_runup_height, rtol=1.0/N)
 
-        q, loc = get_maximum_inundation_data('runup_test.sww',
+        q, loc = get_maximum_inundation_data(filename+'.sww',
                                              time_interval=[3.0, 3.0])
         msg = 'We got %f, should have been %f' % (q, final_runup_height)
@@ -641,11 +644,11 @@
         assert num.allclose(-loc[0]/2, q)    # From topography formula
 
-        q = get_maximum_inundation_elevation('runup_test.sww')
-        loc = get_maximum_inundation_location('runup_test.sww')
+        q = get_maximum_inundation_elevation(filename+'.sww')
+        loc = get_maximum_inundation_location(filename+'.sww')
         msg = 'We got %f, should have been %f' % (q, q_max)
         assert num.allclose(q, q_max, rtol=1.0/N), msg
         assert num.allclose(-loc[0]/2, q)    # From topography formula
 
-        q = get_maximum_inundation_elevation('runup_test.sww',
+        q = get_maximum_inundation_elevation(filename+'.sww',
                                              time_interval=[0, 3])
         msg = 'We got %f, should have been %f' % (q, q_max)
@@ -655,5 +658,5 @@
         # Runup region
         polygon = [[0.3, 0.0], [0.9, 0.0], [0.9, 1.0], [0.3, 1.0]]
-        q = get_maximum_inundation_elevation('runup_test.sww',
+        q = get_maximum_inundation_elevation(filename+'.sww',
                                              polygon = polygon,
                                              time_interval=[0, 3])
@@ -663,5 +666,5 @@
         # Offshore region
         polygon = [[0.9, 0.0], [1.0, 0.0], [1.0, 1.0], [0.9, 1.0]]
-        q, loc = get_maximum_inundation_data('runup_test.sww',
+        q, loc = get_maximum_inundation_data(filename+'.sww',
                                              polygon = polygon,
                                              time_interval=[0, 3])
@@ -673,5 +676,5 @@
         # Dry region
         polygon = [[0.0, 0.0], [0.4, 0.0], [0.4, 1.0], [0.0, 1.0]]
-        q, loc = get_maximum_inundation_data('runup_test.sww',
+        q, loc = get_maximum_inundation_data(filename+'.sww',
                                              polygon = polygon,
                                              time_interval=[0, 3])
@@ -683,5 +686,5 @@
         # Check what happens if no time point is within interval
         try:
-            q = get_maximum_inundation_elevation('runup_test.sww',
+            q = get_maximum_inundation_elevation(filename+'.sww',
                                                  time_interval=[2.75, 2.75])
         except AssertionError:
@@ -713,4 +716,5 @@
         initial_runup_height = -0.4
         final_runup_height = -0.3
+        filename = 'runup_test_2'
 
         #--------------------------------------------------------------
@@ -720,5 +724,5 @@
         points, vertices, boundary = rectangular_cross(N, N)
         domain = Domain(points, vertices, boundary)
-        domain.set_name('runup_test')
+        domain.set_name(filename)
         domain.set_maximum_allowed_speed(1.0)
 
@@ -769,9 +773,9 @@
         #--------------------------------------------------------------
         q_ref = domain.get_maximum_inundation_elevation()
-        q = get_maximum_inundation_elevation('runup_test.sww')
+        q = get_maximum_inundation_elevation(filename+'.sww')
         msg = 'We got %f, should have been %f' % (q, q_ref)
         assert num.allclose(q, q_ref, rtol=1.0/N), msg
 
-        q = get_maximum_inundation_elevation('runup_test.sww')
+        q = get_maximum_inundation_elevation(filename+'.sww')
         msg = 'We got %f, should have been %f' % (q, initial_runup_height)
         assert num.allclose(q, initial_runup_height, rtol = 1.0/N), msg
@@ -779,5 +783,5 @@
         # Test error condition if time interval is out
         try:
-            q = get_maximum_inundation_elevation('runup_test.sww',
+            q = get_maximum_inundation_elevation(filename+'.sww',
                                                  time_interval=[2.0, 3.0])
         except ValueError:
@@ -788,5 +792,5 @@
 
         # Check correct time interval
-        q, loc = get_maximum_inundation_data('runup_test.sww',
+        q, loc = get_maximum_inundation_data(filename+'.sww',
                                              time_interval=[0.0, 3.0])
         msg = 'We got %f, should have been %f' % (q, initial_runup_height)
@@ -822,5 +826,5 @@
         assert num.allclose(q, final_runup_height, rtol=1.0/N)
 
-        q, loc = get_maximum_inundation_data('runup_test.sww',
+        q, loc = get_maximum_inundation_data(filename+'.sww',
                                              time_interval=[3.0, 3.0])
         msg = 'We got %f, should have been %f' % (q, final_runup_height)
@@ -828,11 +832,11 @@
         assert num.allclose(-loc[0]/2, q)    # From topography formula
 
-        q = get_maximum_inundation_elevation('runup_test.sww')
-        loc = get_maximum_inundation_location('runup_test.sww')
+        q = get_maximum_inundation_elevation(filename+'.sww')
+        loc = get_maximum_inundation_location(filename+'.sww')
         msg = 'We got %f, should have been %f' % (q, q_max)
         assert num.allclose(q, q_max, rtol=1.0/N), msg
         assert num.allclose(-loc[0]/2, q)    # From topography formula
 
-        q = get_maximum_inundation_elevation('runup_test.sww',
+        q = get_maximum_inundation_elevation(filename+'.sww',
                                              time_interval=[0, 3])
         msg = 'We got %f, should have been %f' % (q, q_max)
@@ -842,5 +846,5 @@
         # Runup region
         polygon = [[0.3, 0.0], [0.9, 0.0], [0.9, 1.0], [0.3, 1.0]]
-        q = get_maximum_inundation_elevation('runup_test.sww',
+        q = get_maximum_inundation_elevation(filename+'.sww',
                                              polygon = polygon,
                                              time_interval=[0, 3])
@@ -850,5 +854,5 @@
         # Offshore region
         polygon = [[0.9, 0.0], [1.0, 0.0], [1.0, 1.0], [0.9, 1.0]]
-        q, loc = get_maximum_inundation_data('runup_test.sww',
+        q, loc = get_maximum_inundation_data(filename+'.sww',
                                              polygon = polygon,
                                              time_interval=[0, 3])
@@ -860,5 +864,5 @@
         # Dry region
         polygon = [[0.0, 0.0], [0.4, 0.0], [0.4, 1.0], [0.0, 1.0]]
-        q, loc = get_maximum_inundation_data('runup_test.sww',
+        q, loc = get_maximum_inundation_data(filename+'.sww',
                                              polygon = polygon,
                                              time_interval=[0, 3])
@@ -870,5 +874,5 @@
         # Check what happens if no time point is within interval
         try:
-            q = get_maximum_inundation_elevation('runup_test.sww',
+            q = get_maximum_inundation_elevation(filename+'.sww',
                                                  time_interval=[2.75, 2.75])
         except AssertionError:
Index: /trunk/anuga_core/source/anuga/test_all.py
===================================================================
--- /trunk/anuga_core/source/anuga/test_all.py	(revision 8818)
+++ /trunk/anuga_core/source/anuga/test_all.py	(revision 8819)
@@ -269,5 +269,5 @@
             try:
                 os.remove(file)
-            except:
+            except Exception as inst:
                 pass
             
