Changeset 3266


Ignore:
Timestamp:
Jul 3, 2006, 11:07:07 AM (18 years ago)
Author:
duncan
Message:

comments and testing.

Location:
inundation/geospatial_data
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inundation/geospatial_data/geospatial_data.py

    r3262 r3266  
    690690    Inputed formats are;
    691691    points: List or numeric array of coordinate pairs [xi, eta] of
    692               points or geospatial object
     692              points or geospatial object or points file name
    693693
    694694    mesh_origin: A geo_reference object or 3-tuples consisting of
  • inundation/geospatial_data/test_geospatial_data.py

    r3262 r3266  
    462462        assert allclose(results.get_attributes(attribute_name='speed'), [0.0, 10.0, 40.0])
    463463
     464    def BADtest_loadxya4(self):
     465        """
     466        comma delimited
     467        """
     468        fileName = tempfile.mktemp(".xya")
     469        file = open(fileName,"w")
     470        file.write("elevation  , speed \n\
     4711.0, 0.0, splat, 0.0\n\
     4720.0, 1.0, 0.0, 10.0\n\
     4731.0, 0.0, 10.4, 40.0\n")
     474        file.close()
     475        results = Geospatial_data(fileName, delimiter=',')
     476        os.remove(fileName)
     477#        print 'data', results.get_data_points()
     478        assert allclose(results.get_data_points(), [[1.0, 0.0],[0.0, 1.0],[1.0, 0.0]])
     479        assert allclose(results.get_attributes(attribute_name='elevation'), ["splat", 0.0, 10.4])
     480        assert allclose(results.get_attributes(attribute_name='speed'), [0.0, 10.0, 40.0])
     481       
    464482    def test_read_write_points_file_bad2(self):
    465483        att_dict = {}
Note: See TracChangeset for help on using the changeset viewer.