|
@@ 335-365 (lines=31) @@
|
| 332 |
|
[1.04551548, 1.04546847, 1.04542272]], |
| 333 |
|
rtol=1e-4) |
| 334 |
|
|
| 335 |
|
def test_convert_latlon_arr_mult_arr_unequal(self): |
| 336 |
|
"""Test array latlon conversion for unequal sized multi-dim array""" |
| 337 |
|
(self.lat_out, self.lon_out, |
| 338 |
|
self.r_out) = aacgmv2.convert_latlon_arr(np.array([[60, 61, 62], |
| 339 |
|
[63, 64, 65]]), |
| 340 |
|
np.array([0]), |
| 341 |
|
np.array([300]), self.dtime) |
| 342 |
|
|
| 343 |
|
if not isinstance(self.lat_out, np.ndarray): |
| 344 |
|
raise AssertionError() |
| 345 |
|
if not isinstance(self.lon_out, np.ndarray): |
| 346 |
|
raise AssertionError() |
| 347 |
|
if not isinstance(self.r_out, np.ndarray): |
| 348 |
|
raise AssertionError() |
| 349 |
|
if not (self.r_out.shape == self.lon_out.shape and |
| 350 |
|
self.lat_out.shape == self.r_out.shape and |
| 351 |
|
self.r_out.shape == (2, 3)): |
| 352 |
|
raise AssertionError() |
| 353 |
|
|
| 354 |
|
np.testing.assert_allclose(self.lat_out, |
| 355 |
|
[[58.2257709, 59.3186093, 60.4039740], |
| 356 |
|
[61.4819893, 62.5527635, 63.6163840]], |
| 357 |
|
rtol=1e-4) |
| 358 |
|
np.testing.assert_allclose(self.lon_out, |
| 359 |
|
[[81.1684696, 81.6139893, 82.0871880], |
| 360 |
|
[82.5909499, 83.1285895, 83.7039272]], |
| 361 |
|
rtol=1e-4) |
| 362 |
|
np.testing.assert_allclose(self.r_out, |
| 363 |
|
[[1.04566346, 1.04561304, 1.04556369], |
| 364 |
|
[1.04551548, 1.04546847, 1.04542272]], |
| 365 |
|
rtol=1e-4) |
| 366 |
|
|
| 367 |
|
def test_convert_latlon_arr_badidea(self): |
| 368 |
|
"""Test array latlon conversion for BADIDEA""" |
|
@@ 304-333 (lines=30) @@
|
| 301 |
|
np.testing.assert_allclose(self.r_out, [1.04566346, 1.04561304], |
| 302 |
|
rtol=1e-4) |
| 303 |
|
|
| 304 |
|
def test_convert_latlon_arr_mult_arr_mix(self): |
| 305 |
|
"""Test array latlon conversion for mix type with multi-dim array""" |
| 306 |
|
(self.lat_out, self.lon_out, |
| 307 |
|
self.r_out) = aacgmv2.convert_latlon_arr(np.array([[60, 61, 62], |
| 308 |
|
[63, 64, 65]]), |
| 309 |
|
0, 300, self.dtime) |
| 310 |
|
|
| 311 |
|
if not isinstance(self.lat_out, np.ndarray): |
| 312 |
|
raise AssertionError() |
| 313 |
|
if not isinstance(self.lon_out, np.ndarray): |
| 314 |
|
raise AssertionError() |
| 315 |
|
if not isinstance(self.r_out, np.ndarray): |
| 316 |
|
raise AssertionError() |
| 317 |
|
if not (self.r_out.shape == self.lon_out.shape and |
| 318 |
|
self.lat_out.shape == self.r_out.shape and |
| 319 |
|
self.r_out.shape == (2, 3)): |
| 320 |
|
raise AssertionError() |
| 321 |
|
|
| 322 |
|
np.testing.assert_allclose(self.lat_out, |
| 323 |
|
[[58.2257709, 59.3186093, 60.4039740], |
| 324 |
|
[61.4819893, 62.5527635, 63.6163840]], |
| 325 |
|
rtol=1e-4) |
| 326 |
|
np.testing.assert_allclose(self.lon_out, |
| 327 |
|
[[81.1684696, 81.6139893, 82.0871880], |
| 328 |
|
[82.5909499, 83.1285895, 83.7039272]], |
| 329 |
|
rtol=1e-4) |
| 330 |
|
np.testing.assert_allclose(self.r_out, |
| 331 |
|
[[1.04566346, 1.04561304, 1.04556369], |
| 332 |
|
[1.04551548, 1.04546847, 1.04542272]], |
| 333 |
|
rtol=1e-4) |
| 334 |
|
|
| 335 |
|
def test_convert_latlon_arr_mult_arr_unequal(self): |
| 336 |
|
"""Test array latlon conversion for unequal sized multi-dim array""" |