Changeset 3280 for inundation/coordinate_transforms/test_redfearn.py
- Timestamp:
- Jul 5, 2006, 5:17:40 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/coordinate_transforms/test_redfearn.py
r2253 r3280 7 7 8 8 import unittest 9 from redfearn import *10 9 from Numeric import allclose 11 10 11 from redfearn import * 12 from utilities.anuga_exceptions import ANUGAError 12 13 13 14 #------------------------------------------------------------- … … 139 140 # #assert allclose(northing, 6181725.1724276) 140 141 142 def test_convert_lats_longs(self): 141 143 144 #Site Name: GDA-MGA: (UTM with GRS80 ellipsoid) 145 #Zone: 56 146 #Easting: 222908.705 Northing: 6233785.284 147 #Latitude: -34 0 ' 0.00000 '' Longitude: 150 0 ' 0.00000 '' 148 #Grid Convergence: -1 40 ' 43.13 '' Point Scale: 1.00054660 149 150 lat_gong = degminsec2decimal_degrees(-34,30,0.) 151 lon_gong = degminsec2decimal_degrees(150,55,0.) 152 153 lat_2 = degminsec2decimal_degrees(-34,00,0.) 154 lon_2 = degminsec2decimal_degrees(150,00,0.) 155 156 lats = [lat_gong, lat_2] 157 longs = [lon_gong, lon_2] 158 zone, points = convert_lats_longs(lats, longs) 159 160 assert allclose(points[0][0], 308728.009) 161 assert allclose(points[0][1], 6180432.601) 162 assert allclose(points[1][0], 222908.705) 163 assert allclose(points[1][1], 6233785.284) 164 self.failUnless(zone == 56, 165 'Bad zone error!') 166 def test_convert_lats_longs2(self): 167 168 #Site Name: GDA-MGA: (UTM with GRS80 ellipsoid) 169 #Zone: 56 170 #Easting: 222908.705 Northing: 6233785.284 171 #Latitude: -34 0 ' 0.00000 '' Longitude: 150 0 ' 0.00000 '' 172 #Grid Convergence: -1 40 ' 43.13 '' Point Scale: 1.00054660 173 174 lat_gong = degminsec2decimal_degrees(-34,30,0.) 175 lon_gong = degminsec2decimal_degrees(150,55,0.) 176 177 lat_2 = degminsec2decimal_degrees(34,00,0.) 178 lon_2 = degminsec2decimal_degrees(100,00,0.) 179 180 lats = [lat_gong, lat_2] 181 longs = [lon_gong, lon_2] 182 try: 183 zone, points = convert_lats_longs(lats, longs) 184 except ANUGAError: 185 pass 186 else: 187 self.failUnless(0 ==1, 188 'Error not thrown error!') 142 189 143 190 #-------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.