Index: anuga_core/source/anuga/fit_interpolate/fit.py
===================================================================
--- anuga_core/source/anuga/fit_interpolate/fit.py	(revision 4173)
+++ anuga_core/source/anuga/fit_interpolate/fit.py	(revision 4174)
@@ -30,5 +30,6 @@
 
 from anuga.caching import cache            
-from anuga.geospatial_data.geospatial_data import Geospatial_data, ensure_absolute
+from anuga.geospatial_data.geospatial_data import Geospatial_data, \
+     ensure_absolute
 from anuga.fit_interpolate.general_fit_interpolate import FitInterpolate
 from anuga.utilities.sparse import Sparse, Sparse_CSR
@@ -499,118 +500,4 @@
     return vertex_attributes
 
-
-def obsolete_fit_to_mesh_file(mesh_file, point_file, mesh_output_file,
-                     alpha=DEFAULT_ALPHA, verbose= False,
-                     display_errors = True):
-    """
-    Given a mesh file (tsh) and a point attribute file (xya), fit
-    point attributes to the mesh and write a mesh file with the
-    results.
-
-
-    If data_origin is not None it is assumed to be
-    a 3-tuple with geo referenced
-    UTM coordinates (zone, easting, northing)
-
-    NOTE: Throws IOErrors, for a variety of file problems.
-    
-    """
-    #OBSOLETE
-    #Problems with using blocking and knowing the attribute title..
-
-
-    # Question
-    # should data_origin and mesh_origin be passed in?
-    # No they should be in the data structure
-    #
-    #Should the origin of the mesh be changed using this function?
-    # That is overloading this function.  Have it as a seperate
-    # method, at least initially.
-    
-    from load_mesh.loadASCII import import_mesh_file, \
-                 import_points_file, export_mesh_file, \
-                 concatinate_attributelist
-
-    # FIXME: Use geospatial instead of import_points_file
-    try:
-        mesh_dict = import_mesh_file(mesh_file)
-    except IOError,e:
-        if display_errors:
-            print "Could not load bad file. ", e
-        raise IOError  #Re-raise exception
-        
-    vertex_coordinates = mesh_dict['vertices']
-    triangles = mesh_dict['triangles']
-    if type(mesh_dict['vertex_attributes']) == ArrayType:
-        old_point_attributes = mesh_dict['vertex_attributes'].tolist()
-    else:
-        old_point_attributes = mesh_dict['vertex_attributes']
-
-    if type(mesh_dict['vertex_attribute_titles']) == ArrayType:
-        old_title_list = mesh_dict['vertex_attribute_titles'].tolist()
-    else:
-        old_title_list = mesh_dict['vertex_attribute_titles']
-
-    if verbose: print 'tsh file %s loaded' %mesh_file
-
-    # load in the .pts file
-    try:
-        #point_dict = import_points_file(point_file, verbose=verbose)
-        
-        geospatial = Geospatial_data(point_file)
-        point_coordinates = geospatial.get_data_points(absolute=False)
-    except IOError,e:
-        if display_errors:
-            print "Could not load bad file. ", e
-        raise IOError  #Re-raise exception  
-
-    #point_coordinates = point_dict['pointlist']
-    #get_all_attributes
-    #title_list,point_attributes = concatinate_attributelist(point_dict['attributelist'])
-    title_list,point_attributes = concatinate_attributelist( \
-        geospatial.get_all_attributes())
-
-
-    if mesh_dict.has_key('geo_reference') and not mesh_dict['geo_reference'] is None:
-        mesh_origin = mesh_dict['geo_reference'].get_origin()
-    else:
-        mesh_origin = (56, 0, 0) #FIXME(DSG-DSG)
-
-    if verbose: print "points file loaded"
-    if verbose: print "fitting to mesh"
-    f = fit_to_mesh(vertex_coordinates,
-                    triangles,
-                    point_file,
-                    alpha = alpha,
-                    verbose = verbose,
-                    data_origin = data_origin,
-                    mesh_origin = mesh_origin)
-    if verbose: print "finished fitting to mesh"
-
-    # convert array to list of lists
-    new_point_attributes = f.tolist()
-    #FIXME have this overwrite attributes with the same title - DSG
-    #Put the newer attributes last
-    if old_title_list <> []:
-        old_title_list.extend(title_list)
-        #FIXME can this be done a faster way? - DSG
-        for i in range(len(old_point_attributes)):
-            old_point_attributes[i].extend(new_point_attributes[i])
-        mesh_dict['vertex_attributes'] = old_point_attributes
-        mesh_dict['vertex_attribute_titles'] = old_title_list
-    else:
-        mesh_dict['vertex_attributes'] = new_point_attributes
-        mesh_dict['vertex_attribute_titles'] = title_list
-
-    if verbose: print "exporting to file ", mesh_output_file
-
-    try:
-        export_mesh_file(mesh_output_file, mesh_dict)
-    except IOError,e:
-        if display_errors:
-            print "Could not write file. ", e
-        raise IOError
-
-
 def _fit(*args, **kwargs):
     """Private function for use with caching. Reason is that classes
Index: anuga_core/source/anuga/fit_interpolate/test_fit.py
===================================================================
--- anuga_core/source/anuga/fit_interpolate/test_fit.py	(revision 4173)
+++ anuga_core/source/anuga/fit_interpolate/test_fit.py	(revision 4174)
@@ -6,5 +6,5 @@
 from math import sqrt
 import tempfile
-
+import os
 from Numeric import zeros, take, compress, Float, Int, dot, concatenate, \
      ArrayType, allclose, array
@@ -239,4 +239,5 @@
         #print "answer\n",answer
         assert allclose(f, answer)
+        os.remove(fileName)
 
     def test_fit_to_mesh(self):
@@ -277,4 +278,88 @@
         #print "answer\n",answer
         assert allclose(f, answer)
+        
+        os.remove(fileName)
+   
+    def test_fit_to_mesh_pts(self):
+        a = [-1.0, 0.0]
+        b = [3.0, 4.0]
+        c = [4.0,1.0]
+        d = [-3.0, 2.0] #3
+        e = [-1.0,-2.0]
+        f = [1.0, -2.0] #5
+
+        vertices = [a, b, c, d,e,f]
+        triangles = [[0,1,3], [1,0,2], [0,4,5], [0,5,2]] #abd bac aef afc
+
+
+        fileName = tempfile.mktemp(".xya")
+        file = open(fileName,"w")
+        file.write(" elevation \n\
+-2.0, 2.0, 0.\n\
+-1.0, 1.0, 0.\n\
+0.0, 2.0 , 2.\n\
+1.0, 1.0 , 2.\n\
+ 2.0,  1.0 ,3. \n\
+ 0.0,  0.0 , 0.\n\
+ 1.0,  0.0 , 1.\n\
+ 0.0,  -1.0, -1.\n\
+ -0.2, -0.5, -0.7\n\
+ -0.9, -1.5, -2.4\n\
+ 0.5,  -1.9, -1.4\n\
+ 3.0,  1.0 , 4.\n")
+        file.close()
+
+        geo = Geospatial_data(fileName)
+        fileName_pts = tempfile.mktemp(".pts")
+        geo.export_points_file(fileName_pts)
+        f = fit_to_mesh(vertices, triangles,fileName_pts,
+                                alpha=0.0, max_read_lines=2)
+                        #use_cache=True, verbose=True)
+        answer = linear_function(vertices)
+        #print "f\n",f
+        #print "answer\n",answer
+        assert allclose(f, answer)
+        os.remove(fileName)
+        os.remove(fileName_pts)
+       
+    def test_fit_to_mesh(self):
+
+        a = [-1.0, 0.0]
+        b = [3.0, 4.0]
+        c = [4.0,1.0]
+        d = [-3.0, 2.0] #3
+        e = [-1.0,-2.0]
+        f = [1.0, -2.0] #5
+
+        vertices = [a, b, c, d,e,f]
+        triangles = [[0,1,3], [1,0,2], [0,4,5], [0,5,2]] #abd bac aef afc
+
+
+        fileName = tempfile.mktemp(".ddd")
+        file = open(fileName,"w")
+        file.write(" x,y, elevation \n\
+-2.0, 2.0, 0.\n\
+-1.0, 1.0, 0.\n\
+0.0, 2.0 , 2.\n\
+1.0, 1.0 , 2.\n\
+ 2.0,  1.0 ,3. \n\
+ 0.0,  0.0 , 0.\n\
+ 1.0,  0.0 , 1.\n\
+ 0.0,  -1.0, -1.\n\
+ -0.2, -0.5, -0.7\n\
+ -0.9, -1.5, -2.4\n\
+ 0.5,  -1.9, -1.4\n\
+ 3.0,  1.0 , 4.\n")
+        file.close()
+        
+        f = fit_to_mesh(vertices, triangles,fileName,
+                                alpha=0.0, max_read_lines=2)
+                        #use_cache=True, verbose=True)
+        answer = linear_function(vertices)
+        #print "f\n",f
+        #print "answer\n",answer
+        assert allclose(f, answer)
+    
+        os.remove(fileName)
         
     def test_fit_to_mesh_2_atts(self):
@@ -316,4 +401,5 @@
         #print "answer\n",answer
         assert allclose(f, answer)
+        os.remove(fileName)
         
     def test_fit_and_interpolation(self):
@@ -605,321 +691,4 @@
 
 
-    def obsolete_test_fit_to_mesh_file(self):
-        from load_mesh.loadASCII import import_mesh_file, \
-             export_mesh_file
-        import tempfile
-        import os
-
-        # create a .tsh file, no user outline
-        mesh_dic = {}
-        mesh_dic['vertices'] = [[0.0, 0.0],
-                                          [0.0, 5.0],
-                                          [5.0, 0.0]]
-        mesh_dic['triangles'] =  [[0, 2, 1]]
-        mesh_dic['segments'] = [[0, 1], [2, 0], [1, 2]]
-        mesh_dic['triangle_tags'] = ['']
-        mesh_dic['vertex_attributes'] = [[], [], []]
-        mesh_dic['vertiex_attribute_titles'] = []
-        mesh_dic['triangle_neighbors'] = [[-1, -1, -1]]
-        mesh_dic['segment_tags'] = ['external',
-                                                  'external',
-                                                  'external']
-        mesh_file = tempfile.mktemp(".tsh")
-        export_mesh_file(mesh_file,mesh_dic)
-
-        # create an .xya file
-        point_file = tempfile.mktemp(".xya")
-        fd = open(point_file,'w')
-        fd.write("elevation, stage \n 1.0, 1.0,2.,4 \n 1.0, 3.0,4,8 \n 3.0,1.0,4.,8 \n")
-        fd.close()
-
-        mesh_output_file = tempfile.mktemp(".tsh") 
-        fit_to_mesh_file(mesh_file,
-                         point_file,
-                         mesh_output_file,
-                         alpha = 0.0)
-        # load in the .tsh file we just wrote
-        mesh_dic = import_mesh_file(mesh_output_file)
-        #print "mesh_dic",mesh_dic
-        ans =[[0.0, 0.0],
-              [5.0, 10.0],
-              [5.0,10.0]]
-        assert allclose(mesh_dic['vertex_attributes'],ans)
-
-        self.failUnless(mesh_dic['vertex_attribute_titles']  ==
-                        ['elevation','stage'],
-                        'test_fit_to_mesh_file failed')
-
-        #clean up
-        os.remove(mesh_file)
-        os.remove(point_file)
-        os.remove(mesh_output_file)
-
-
-    def obsolete_test_fit_to_mesh_file3(self):
-        from load_mesh.loadASCII import import_mesh_file, \
-             export_mesh_file
-        import tempfile
-        import os
-
-        # create a .tsh file, no user outline
-        mesh_dic = {}
-        mesh_dic['vertices'] = [[0.76, 0.76],
-                                          [0.76, 5.76],
-                                          [5.76, 0.76]]
-        mesh_dic['triangles'] =  [[0, 2, 1]]
-        mesh_dic['segments'] = [[0, 1], [2, 0], [1, 2]]
-        mesh_dic['triangle_tags'] = ['']
-        mesh_dic['vertex_attributes'] = [[], [], []]
-        mesh_dic['vertiex_attribute_titles'] = []
-        mesh_dic['triangle_neighbors'] = [[-1, -1, -1]]
-        mesh_dic['segment_tags'] = ['external',
-                                                  'external',
-                                                  'external']
-        mesh_dic['geo_reference'] = Geo_reference(56,-0.76,-0.76)
-        mesh_file = tempfile.mktemp(".tsh")
-        export_mesh_file(mesh_file,mesh_dic)
-
-        # create an .xya file
-        point_file = tempfile.mktemp(".xya")
-        fd = open(point_file,'w')
-        fd.write("elevation, stage \n 1.0, 1.0,2.,4 \n 1.0, 3.0,4,8 \n 3.0,1.0,4.,8 \n")
-        fd.close()
-
-        mesh_output_file = tempfile.mktemp(".tsh")
-        fit_to_mesh_file(mesh_file,
-                         point_file,
-                         mesh_output_file,
-                         alpha = 0.0)
-        # load in the .tsh file we just wrote
-        mesh_dic = import_mesh_file(mesh_output_file)
-        #print "mesh_dic",mesh_dic
-        ans =[[0.0, 0.0],
-              [5.0, 10.0],
-              [5.0,10.0]]
-        assert allclose(mesh_dic['vertex_attributes'],ans)
-
-        self.failUnless(mesh_dic['vertex_attribute_titles']  ==
-                        ['elevation','stage'],
-                        'test_fit_to_mesh_file failed')
-
-        #clean up
-        os.remove(mesh_file)
-        os.remove(point_file)
-        os.remove(mesh_output_file)
-
-    def obsolete_test_fit_to_mesh_file4(self):
-        from load_mesh.loadASCII import import_mesh_file, \
-             export_mesh_file
-        import tempfile
-        import os
-
-        # create a .tsh file, no user outline
-        mesh_dic = {}
-        mesh_dic['vertices'] = [[0.76, 0.76],
-                                [0.76, 5.76],
-                                [5.76, 0.76]]
-        mesh_dic['triangles'] =  [[0, 2, 1]]
-        mesh_dic['segments'] = [[0, 1], [2, 0], [1, 2]]
-        mesh_dic['triangle_tags'] = ['']
-        mesh_dic['vertex_attributes'] = [[], [], []]
-        mesh_dic['vertiex_attribute_titles'] = []
-        mesh_dic['triangle_neighbors'] = [[-1, -1, -1]]
-        mesh_dic['segment_tags'] = ['external',
-                                    'external',
-                                    'external']
-        mesh_dic['geo_reference'] = Geo_reference(56,-0.76,-0.76)
-        mesh_file = tempfile.mktemp(".tsh")
-        export_mesh_file(mesh_file,mesh_dic)
-
-        geo_ref = Geo_reference(56,-200,-400)
-        # create an .xya file
-        point_file = tempfile.mktemp(".xya")
-        fd = open(point_file,'w')
-        fd.write("elevation, stage \n 201.0, 401.0,2.,4 \n 201.0, 403.0,4,8 \n 203.0, 401.0,4.,8 \n")
-        geo_ref.write_ASCII(fd)
-        fd.close()
-
-        mesh_output_file = tempfile.mktemp(".tsh")
-        fit_to_mesh_file(mesh_file,
-                         point_file,
-                         mesh_output_file,
-                         alpha = 0.0)
-        # load in the .tsh file we just wrote
-        mesh_dic = import_mesh_file(mesh_output_file)
-        #print "mesh_dic",mesh_dic
-        ans =[[0.0, 0.0],
-              [5.0, 10.0],
-              [5.0, 10.0]]
-        assert allclose(mesh_dic['vertex_attributes'],ans)
-
-        self.failUnless(mesh_dic['vertex_attribute_titles']  ==
-                        ['elevation','stage'],
-                        'test_fit_to_mesh_file failed')
-
-        #clean up
-        os.remove(mesh_file)
-        os.remove(point_file)
-        os.remove(mesh_output_file)
-
-    def obsolete_test_fit_to_mesh_fileII(self):
-        from load_mesh.loadASCII import import_mesh_file, \
-             export_mesh_file
-        import tempfile
-        import os
-
-        # create a .tsh file, no user outline
-        mesh_dic = {}
-        mesh_dic['vertices'] = [[0.0, 0.0],
-                                [0.0, 5.0],
-                                [5.0, 0.0]]
-        mesh_dic['triangles'] =  [[0, 2, 1]]
-        mesh_dic['segments'] = [[0, 1], [2, 0], [1, 2]]
-        mesh_dic['triangle_tags'] = ['']
-        mesh_dic['vertex_attributes'] = [[1,2], [1,2], [1,2]]
-        mesh_dic['vertex_attribute_titles'] = ['density', 'temp']
-        mesh_dic['triangle_neighbors'] = [[-1, -1, -1]]
-        mesh_dic['segment_tags'] = ['external',
-                                                  'external',
-                                                  'external']
-        mesh_file = tempfile.mktemp(".tsh")
-        export_mesh_file(mesh_file,mesh_dic)
-
-        # create an .xya file
-        point_file = tempfile.mktemp(".xya")
-        fd = open(point_file,'w')
-        fd.write("elevation, stage \n 1.0, 1.0,2.,4 \n 1.0, 3.0,4,8 \n 3.0,1.0,4.,8 \n")
-        fd.close()
-
-        mesh_output_file = "new_triangle.tsh"
-        fit_to_mesh_file(mesh_file,
-                         point_file,
-                         mesh_output_file,
-                         alpha = 0.0)
-        # load in the .tsh file we just wrote
-        mesh_dic = import_mesh_file(mesh_output_file)
-
-        assert allclose(mesh_dic['vertex_attributes'],
-                        [[1.0, 2.0,0.0, 0.0],
-                         [1.0, 2.0,5.0, 10.0],
-                         [1.0, 2.0,5.0,10.0]])
-
-        self.failUnless(mesh_dic['vertex_attribute_titles']  ==
-                        ['density', 'temp','elevation','stage'],
-                        'test_fit_to_mesh_file failed')
-
-        #clean up
-        os.remove(mesh_file)
-        os.remove(mesh_output_file)
-        os.remove(point_file)
-
-    def obsolete_test_fit_to_mesh_file_errors(self):
-        from load_mesh.loadASCII import import_mesh_file, export_mesh_file
-        import tempfile
-        import os
-
-        # create a .tsh file, no user outline
-        mesh_dic = {}
-        mesh_dic['vertices'] = [[0.0, 0.0],[0.0, 5.0],[5.0, 0.0]]
-        mesh_dic['triangles'] =  [[0, 2, 1]]
-        mesh_dic['segments'] = [[0, 1], [2, 0], [1, 2]]
-        mesh_dic['triangle_tags'] = ['']
-        mesh_dic['vertex_attributes'] = [[1,2], [1,2], [1,2]]
-        mesh_dic['vertex_attribute_titles'] = ['density', 'temp']
-        mesh_dic['triangle_neighbors'] = [[-1, -1, -1]]
-        mesh_dic['segment_tags'] = ['external', 'external','external']
-        mesh_file = tempfile.mktemp(".tsh")
-        export_mesh_file(mesh_file,mesh_dic)
-
-        # create an .xya file
-        point_file = tempfile.mktemp(".xya")
-        fd = open(point_file,'w')
-        fd.write("elevation stage \n 1.0, 1.0,2.,4 \n 1.0, 3.0,4,8 \n 3.0,1.0,4.,8 \n")
-        fd.close()
-
-        mesh_output_file = "new_triangle.tsh"
-        try:
-            fit_to_mesh_file(mesh_file, point_file,
-                             mesh_output_file, display_errors = False)
-        except IOError:
-            pass
-        else:
-            #self.failUnless(0 ==1,  'Bad file did not raise error!')
-            raise 'Bad file did not raise error!'
-            
-        #clean up
-        os.remove(mesh_file)
-        os.remove(point_file)
-
-    def obsolete_test_fit_to_mesh_file_errorsII(self):
-        from load_mesh.loadASCII import import_mesh_file, export_mesh_file
-        import tempfile
-        import os
-
-        # create a .tsh file, no user outline
-        mesh_file = tempfile.mktemp(".tsh")
-        fd = open(mesh_file,'w')
-        fd.write("unit testing a bad .tsh file \n")
-        fd.close()
-
-        # create an .xya file
-        point_file = tempfile.mktemp(".xya")
-        fd = open(point_file,'w')
-        fd.write("elevation, stage \n 1.0, 1.0,2.,4 \n 1.0, 3.0,4,8 \n 3.0,1.0,4.,8 \n")
-        fd.close()
-
-        mesh_output_file = "new_triangle.tsh"
-        try:
-            fit_to_mesh_file(mesh_file, point_file,
-                             mesh_output_file, display_errors = False)
-        except IOError:
-            pass
-        else:
-            raise 'Bad file did not raise error!'
-            
-        #clean up
-        os.remove(mesh_file)
-        os.remove(point_file)
-
-    def obsolete_test_fit_to_mesh_file_errorsIII(self):
-        from load_mesh.loadASCII import import_mesh_file, export_mesh_file
-        import tempfile
-        import os
-
-        # create a .tsh file, no user outline
-        mesh_dic = {}
-        mesh_dic['vertices'] = [[0.0, 0.0],[0.0, 5.0],[5.0, 0.0]]
-        mesh_dic['triangles'] =  [[0, 2, 1]]
-        mesh_dic['segments'] = [[0, 1], [2, 0], [1, 2]]
-        mesh_dic['triangle_tags'] = ['']
-        mesh_dic['vertex_attributes'] = [[1,2], [1,2], [1,2]]
-        mesh_dic['vertex_attribute_titles'] = ['density', 'temp']
-        mesh_dic['triangle_neighbors'] = [[-1, -1, -1]]
-        mesh_dic['segment_tags'] = ['external', 'external','external']
-        mesh_file = tempfile.mktemp(".tsh")
-        export_mesh_file(mesh_file,mesh_dic)
-
-        # create an .xya file
-        point_file = tempfile.mktemp(".xya")
-        fd = open(point_file,'w')
-        fd.write("elevation, stage \n 1.0, 1.0,2.,4 \n 1.0, 3.0,4,8 \n 3.0,1.0,4.,8 \n")
-        fd.close()
-
-        #This a deliberately illegal filename to invoke the error.
-        mesh_output_file = ".../\z\z:ya.tsh"        
-
-        try:
-            fit_to_mesh_file(mesh_file, point_file,
-                             mesh_output_file, display_errors = False)
-        except IOError:
-            pass
-        else:
-            raise 'Bad file did not raise error!'
-        
-        #clean up
-        os.remove(mesh_file)
-        os.remove(point_file)
-
-
     def Not_yet_test_smooth_att_to_mesh_with_excess_verts(self):
 
Index: anuga_core/source/anuga/geospatial_data/geospatial_data.py
===================================================================
--- anuga_core/source/anuga/geospatial_data/geospatial_data.py	(revision 4173)
+++ anuga_core/source/anuga/geospatial_data/geospatial_data.py	(revision 4174)
@@ -7,5 +7,4 @@
 from types import DictType
 from warnings import warn
-import sys
 
 from Numeric import concatenate, array, Float, shape, reshape, ravel, take, \
@@ -705,22 +704,39 @@
 
         #FIXME - give warning if the file format is .xya
-        file_pointer = open(self.file_name)
-        self.header, self.file_pointer = _read_csv_file_header(file_pointer)
-
-        if self.max_read_lines is None:
-            self.max_read_lines = MAX_READ_LINES
+        if self.file_name[-4:]== ".xya" or self.file_name[-4:]== ".pts":
+            #let's just read it all
+            pass
+        else:
+            file_pointer = open(self.file_name)
+            self.header, self.file_pointer = \
+                         _read_csv_file_header(file_pointer)
+
+            if self.max_read_lines is None:
+                self.max_read_lines = MAX_READ_LINES
         return self
     
     def next(self):
         # read a block, instanciate a new geospatial and return it
-        try:
-            pointlist, att_dict, self.file_pointer = _read_csv_file_blocking( \
-                self.file_pointer,
-                self.header[:],
-                max_read_lines=self.max_read_lines) 
-        except StopIteration:
-            self.file_pointer.close()
-            raise StopIteration
-        return Geospatial_data(pointlist, att_dict)
+        if self.file_name[-4:]== ".xya" or self.file_name[-4:]== ".pts":
+            if not hasattr(self,'finished_reading') or \
+                   self.finished_reading is False:
+                #let's just read it all
+                geo = Geospatial_data(self.file_name)
+                self.finished_reading = True
+            else:
+                raise StopIteration
+                self.finished_reading = False
+                
+        else:
+            try:
+                pointlist, att_dict, self.file_pointer = \
+                   _read_csv_file_blocking( self.file_pointer,
+                                         self.header[:],
+                                         max_read_lines=self.max_read_lines) 
+                geo = Geospatial_data(pointlist, att_dict)
+            except StopIteration:
+                self.file_pointer.close()
+                raise StopIteration
+        return geo
 
 def _read_pts_file(file_name, verbose=False):
@@ -788,4 +804,7 @@
     """
     
+    #from anuga.shallow_water.data_manager import Exposure_csv
+    #csv =Exposure_csv(file_name)
+    
     file_pointer = open(file_name)
     header, file_pointer = _read_csv_file_header(file_pointer)
@@ -796,5 +815,5 @@
                 file_pointer,
                 header,
-                max_read_lines=sys.maxint) #This might not be high enough...
+                max_read_lines=MAX_READ_LINES) #FIXME: must be highest int
         except StopIteration:
             break
