Changeset 5420 for anuga_core/source/anuga/shallow_water/data_manager.py
- Timestamp:
- Jun 24, 2008, 12:38:54 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/data_manager.py
r5418 r5420 5081 5081 outfile.close() 5082 5082 5083 def create_sts_boundary(order_file,stsname ):5083 def create_sts_boundary(order_file,stsname,lat_long=True): 5084 5084 """ 5085 5085 Create boundary segments from .sts file. Points can be stored in … … 5107 5107 raise Exception, msg 5108 5108 5109 if len(lines)<2: 5110 msg = 'File must contain at least two points' 5111 raise Exception, msg 5112 5109 5113 try: 5110 5114 fid = NetCDFFile(stsname+'.sts', 'r') … … 5132 5136 fields = line.split(',') 5133 5137 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]) 5138 5146 if not allclose(array([easting,northing]),sts_points[index]): 5139 5147 msg = "Points in sts file do not match those in the"+\
Note: See TracChangeset
for help on using the changeset viewer.