Changeset 5420


Ignore:
Timestamp:
Jun 24, 2008, 12:38:54 PM (14 years ago)
Author:
jakeman
Message:

added test ic create_sts boundary to make sure that there are at least two points in file being read

Location:
anuga_core/source/anuga/shallow_water
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/shallow_water/data_manager.py

    r5418 r5420  
    50815081    outfile.close()
    50825082
    5083 def create_sts_boundary(order_file,stsname):
     5083def create_sts_boundary(order_file,stsname,lat_long=True):
    50845084    """
    50855085        Create boundary segments from .sts file. Points can be stored in
     
    51075107        raise Exception, msg
    51085108
     5109    if len(lines)<2:
     5110        msg = 'File must contain at least two points'
     5111        raise Exception, msg
     5112
    51095113    try:
    51105114        fid = NetCDFFile(stsname+'.sts', 'r')
     
    51325136        fields = line.split(',')
    51335137        index=int(fields[0])
    5134         zone,easting,northing=redfearn(float(fields[1]),float(fields[2]))
    5135         if not zone == fid.zone[0]:
    5136             msg = 'Inconsitent zones'
    5137             raise Exception, msg
     5138        if lat_long:
     5139            zone,easting,northing=redfearn(float(fields[1]),float(fields[2]))
     5140            if not zone == fid.zone[0]:
     5141                msg = 'Inconsitent zones'
     5142                raise Exception, msg
     5143        else:
     5144            easting = float(fields[1])
     5145            northing = float(fields[2])
    51385146        if not allclose(array([easting,northing]),sts_points[index]):
    51395147            msg = "Points in sts file do not match those in the"+\
  • anuga_core/source/anuga/shallow_water/test_data_manager.py

    r5418 r5420  
    86768676    #suite = unittest.makeSuite(Test_Data_Manager,'test_export_gridII')
    86778677#    suite = unittest.makeSuite(Test_Data_Manager,'test_screen_catcher')
    8678 <<<<<<< .mine
    8679     suite = unittest.makeSuite(Test_Data_Manager,'test')
    8680 =======
    8681     #suite = unittest.makeSuite(Test_Data_Manager,'test_urs2stsII')
    8682 >>>>>>> .r5417
    86838678    #suite = unittest.makeSuite(Test_Data_Manager,'test_get_flow_through_cross_section_with_geo')
    86848679    #suite = unittest.makeSuite(Test_Data_Manager,'covered_')
Note: See TracChangeset for help on using the changeset viewer.