Ignore:
Timestamp:
Jun 24, 2008, 12:38:54 PM (15 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

File:
1 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"+\
Note: See TracChangeset for help on using the changeset viewer.