- Timestamp:
- Jan 13, 2009, 1:17:54 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/coordinate_transforms/geo_reference.py
r5736 r6149 8 8 9 9 import types, sys 10 from Numeric import array, Float, ArrayType, reshape, allclose11 10 from anuga.utilities.numerical_tools import ensure_numeric 12 11 from anuga.utilities.anuga_exceptions import ANUGAError, TitleError, ParsingError, \ 13 12 ShapeError 13 14 import Numeric as num 14 15 15 16 … … 98 99 99 100 # Fix some assertion failures 100 if type(self.zone) == ArrayType and self.zone.shape == ():101 if type(self.zone) == num.ArrayType and self.zone.shape == (): 101 102 self.zone = self.zone[0] 102 if type(self.xllcorner) == ArrayType and self.xllcorner.shape == ():103 if type(self.xllcorner) == num.ArrayType and self.xllcorner.shape == (): 103 104 self.xllcorner = self.xllcorner[0] 104 if type(self.yllcorner) == ArrayType and self.yllcorner.shape == ():105 if type(self.yllcorner) == num.ArrayType and self.yllcorner.shape == (): 105 106 self.yllcorner = self.yllcorner[0] 106 107 … … 172 173 173 174 # Fix some assertion failures 174 if(type(self.zone) == ArrayType and self.zone.shape == ()):175 if(type(self.zone) == num.ArrayType and self.zone.shape == ()): 175 176 self.zone = self.zone[0] 176 if type(self.xllcorner) == ArrayType and self.xllcorner.shape == ():177 if type(self.xllcorner) == num.ArrayType and self.xllcorner.shape == (): 177 178 self.xllcorner = self.xllcorner[0] 178 if type(self.yllcorner) == ArrayType and self.yllcorner.shape == ():179 if type(self.yllcorner) == num.ArrayType and self.yllcorner.shape == (): 179 180 self.yllcorner = self.yllcorner[0] 180 181 … … 196 197 is_list = True 197 198 198 points = ensure_numeric(points, Float)199 points = ensure_numeric(points, num.Float) 199 200 200 201 if len(points.shape) == 1: … … 202 203 msg = 'Single point must have two elements' 203 204 assert len(points) == 2, msg 204 points = reshape(points, (1,2))205 points = num.reshape(points, (1,2)) 205 206 206 207 msg = 'Points array must be two dimensional.\n' … … 239 240 """ 240 241 241 return allclose([self.xllcorner, self.yllcorner], 0)242 return num.allclose([self.xllcorner, self.yllcorner], 0) 242 243 243 244 … … 255 256 is_list = True 256 257 257 points = ensure_numeric(points, Float)258 points = ensure_numeric(points, num.Float) 258 259 if len(points.shape) == 1: 259 260 #One point has been passed … … 295 296 is_list = True 296 297 297 points = ensure_numeric(points, Float)298 points = ensure_numeric(points, num.Float) 298 299 if len(points.shape) == 1: 299 300 #One point has been passed
Note: See TracChangeset
for help on using the changeset viewer.