- Timestamp:
- Feb 24, 2009, 6:13:06 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/coordinate_transforms/test_redfearn.py
r6400 r6404 10 10 from redfearn import * 11 11 from anuga.utilities.anuga_exceptions import ANUGAError 12 12 from anuga.utilities.system_tools import get_pathname_from_package 13 from os.path import join 13 14 import Numeric as num 14 15 … … 273 274 274 275 275 def test_nonstandard_meridian(self):276 def Xtest_nonstandard_meridian(self): 276 277 """test_nonstandard_meridian 277 278 … … 279 280 points using an arbitrary central meridian. 280 281 """ 281 282 283 # FIXME: To do using csv file284 pass285 286 282 287 283 # The file projection_test_points.csv contains 10 points … … 291 287 # in the middle of zones 53 and 54). 292 288 293 294 295 289 path = get_pathname_from_package('anuga.coordinate_transforms') 290 datafile = join(path, 'projection_test_points.csv') 291 fid = open(datafile) 292 293 for line in fid.readlines()[1:]: 294 fields = line.strip().split(',') 295 296 lon = float(fields[1]) 297 lat = float(fields[2]) 298 x = float(fields[3]) 299 y = float(fields[4]) 300 301 zone, easting, northing = redfearn(lat, lon, 302 central_meridian=137.5) 303 304 print 305 print 'Lat', lat 306 print 'Lon', lon 307 print 'Zone', zone 308 print 'Ref x', x, 'Computed x', easting, 'Close enough:', num.allclose(x, easting) 309 print 'Ref y', y, 'Computed y', northing, 'Close enough:', num.allclose(y, northing) 310 311 # Check calculation 312 assert zone == -1 # Indicates non UTM projection 313 print 314 #assert num.allclose(x, easting) 315 #assert num.allclose(y, northing) 316 317 # Test that zone and meridian can't both be specified 318 try: 319 zone, easting, northing = redfearn(lat, lon, 320 zone=50, central_meridian=137.5) 321 except: 322 pass 323 else: 324 msg = 'Should have raised exception' 325 raise Exception, msg 296 326 297 327 def test_convert_lats_longs(self):
Note: See TracChangeset
for help on using the changeset viewer.