Changeset 6440
- Timestamp:
- Mar 3, 2009, 9:34:00 PM (16 years ago)
- Location:
- anuga_core/source/anuga/coordinate_transforms
- Files:
-
- 4 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/coordinate_transforms/test_redfearn.py
r6424 r6440 274 274 275 275 276 277 def Xtest_nonstandard_meridian_coinciding_with_native(self): 278 """test_nonstandard_meridian_coinciding_with_native 279 280 This test will verify that redfearn can be used to project 281 points using an arbitrary central meridian that happens to 282 coincide with the standard meridian at the center of a UTM zone. 283 This is a preliminary test before testing this functionality 284 with a truly arbitrary non-standard meridian. 285 """ 286 287 # The file projection_test_points_z53.csv contains 10 points 288 # which straddle the boundary between UTM zones 53 and 54. 289 # They have been projected to zone 53 irrespective of where they 290 # belong. 291 292 path = get_pathname_from_package('anuga.coordinate_transforms') 293 294 for forced_zone in [53, 54]: 295 296 datafile = join(path, 'projection_test_points_z%d.csv' % forced_zone) 297 fid = open(datafile) 298 299 for line in fid.readlines()[1:]: 300 fields = line.strip().split(',') 301 302 lon = float(fields[1]) 303 lat = float(fields[2]) 304 x = float(fields[3]) 305 y = float(fields[4]) 306 307 zone, easting, northing = redfearn(lat, lon, 308 zone=forced_zone) 309 310 print 311 print 'Lat', lat 312 print 'Lon', lon 313 print 'Zone', zone 314 print 'Ref x', x, 'Computed x', easting, 'Close enough:', num.allclose(x, easting) 315 print 'Ref y', y, 'Computed y', northing, 'Close enough:', num.allclose(y, northing) 316 317 # Check calculation 318 assert zone == forced_zone 319 print 320 #assert num.allclose(x, easting) 321 #assert num.allclose(y, northing) 322 323 324 325 276 326 def Xtest_nonstandard_meridian(self): 277 327 """test_nonstandard_meridian … … 301 351 zone, easting, northing = redfearn(lat, lon, 302 352 central_meridian=137.5, 303 scale_factor=0.999 8154)353 scale_factor=0.9996) 304 354 305 355 print … … 320 370 zone, easting, northing = redfearn(lat, lon, 321 371 zone=50, 322 central_meridian=137.5, 323 scale_factor=0.968) 372 central_meridian=137.5) 324 373 except: 325 374 pass … … 328 377 raise Exception, msg 329 378 379 330 380 def test_convert_lats_longs(self): 331 381 … … 475 525 476 526 #mysuite = unittest.makeSuite(TestCase,'test_convert_latlon_to_UTM1') 477 #mysuite = unittest.makeSuite(TestCase,'test_UTM_6_nonstandard_projection')478 mysuite = unittest.makeSuite(TestCase,'test')527 mysuite = unittest.makeSuite(TestCase,'test_nonstandard_meridian_coinciding_with_native') 528 #mysuite = unittest.makeSuite(TestCase,'test') 479 529 runner = unittest.TextTestRunner() 480 530 runner.run(mysuite)
Note: See TracChangeset
for help on using the changeset viewer.