- Timestamp:
- May 20, 2009, 3:45:43 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/coordinate_transforms/geo_reference.py
r6546 r7062 58 58 if zone is None: 59 59 zone = DEFAULT_ZONE 60 self.false_easting = false_easting61 self.false_northing = false_northing60 self.false_easting = int(false_easting) 61 self.false_northing = int(false_northing) 62 62 self.datum = datum 63 63 self.projection = projection 64 self.zone = zone64 self.zone = int(zone) 65 65 self.units = units 66 self.xllcorner = xllcorner67 self.yllcorner = yllcorner66 self.xllcorner = float(xllcorner) 67 self.yllcorner = float(yllcorner) 68 68 69 69 if NetCDFObject is not None: … … 99 99 100 100 def read_NetCDF(self, infile): 101 self.xllcorner = infile.xllcorner[0] 102 self.yllcorner = infile.yllcorner[0] 103 self.zone = infile.zone[0] 104 105 106 # Fix some assertion failures 107 if type(self.zone) == num.ArrayType and self.zone.shape == (): 108 self.zone = self.zone[0] 109 if type(self.xllcorner) == num.ArrayType and self.xllcorner.shape == (): 110 self.xllcorner = self.xllcorner[0] 111 if type(self.yllcorner) == num.ArrayType and self.yllcorner.shape == (): 112 self.yllcorner = self.yllcorner[0] 113 114 assert (type(self.xllcorner) == types.FloatType or\ 115 type(self.xllcorner) == types.IntType) 116 assert (type(self.yllcorner) == types.FloatType or\ 117 type(self.yllcorner) == types.IntType) 118 assert (type(self.zone) == types.IntType) 119 101 self.xllcorner = float(infile.xllcorner[0]) 102 self.yllcorner = float(infile.yllcorner[0]) 103 self.zone = int(infile.zone[0]) 104 120 105 try: 121 self.false_easting = in file.false_easting[0]122 self.false_northing = in file.false_northing[0]123 124 self.datum = infile.datum 106 self.false_easting = int(infile.false_easting[0]) 107 self.false_northing = int(infile.false_northing[0]) 108 109 self.datum = infile.datum 125 110 self.projection = infile.projection 126 111 self.units = infile.units 127 112 except: 128 113 pass 114 129 115 if (self.false_easting != DEFAULT_FALSE_EASTING): 130 116 print "WARNING: False easting of %f specified." %self.false_easting
Note: See TracChangeset
for help on using the changeset viewer.