Changeset 2942 for inundation/coordinate_transforms
- Timestamp:
- May 23, 2006, 10:50:19 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/coordinate_transforms/geo_reference.py
r2941 r2942 9 9 from Numeric import array, Float, ArrayType, reshape 10 10 from utilities.numerical_tools import ensure_numeric 11 from utilities.anuga_exceptions import ANUGAError 12 13 import exceptions 14 class TitleError(exceptions.IOError): pass 11 from utilities.anuga_exceptions import ANUGAError, TitleError, ParsingError 12 13 14 #import exceptions 15 #class TitleError(exceptions.IOError): pass 16 #class ParsingError(exceptions.IOError): pass 15 17 16 18 DEFAULT_ZONE = -1 … … 107 109 108 110 def read_ASCII(self, fd,read_title=None): 109 if read_title == None: 110 read_title = fd.readline() # remove the title line 111 #print "gr read_title[0:2].upper()",read_title[0:2].upper() 112 #print "gr TITLE[0:2].upper()",TITLE[0:2].upper() 113 if read_title[0:2].upper() != TITLE[0:2].upper(): 114 msg = 'File error. Expecting line: %s. Got this line: %s' \ 115 %(TITLE, read_title) 116 raise TitleError, msg 117 self.zone = int(fd.readline()) 118 self.xllcorner = float(fd.readline()) 119 self.yllcorner = float(fd.readline()) 111 try: 112 if read_title == None: 113 read_title = fd.readline() # remove the title line 114 if read_title[0:2].upper() != TITLE[0:2].upper(): 115 msg = 'File error. Expecting line: %s. Got this line: %s' \ 116 %(TITLE, read_title) 117 raise TitleError, msg 118 self.zone = int(fd.readline()) 119 self.xllcorner = float(fd.readline()) 120 self.yllcorner = float(fd.readline()) 121 except SyntaxError: 122 msg = 'File error. Got syntax error while parsing geo reference' 123 raise ParsingError, msg 120 124 121 125 # Fix some assertion failures
Note: See TracChangeset
for help on using the changeset viewer.