|
@@ 462-474 (lines=13) @@
|
| 459 |
|
self.mlt_out) = aacgmv2.get_aacgm_coord_arr( |
| 460 |
|
np.array([[60, 61, 62], [63, 64, 65]]), 0, 300, self.dtime) |
| 461 |
|
|
| 462 |
|
def test_get_aacgm_coord_arr_badidea(self): |
| 463 |
|
"""Test array AACGMV2 calculation for BADIDEA""" |
| 464 |
|
self.method = "|".join([self.method, "BADIDEA"]) |
| 465 |
|
self.out = aacgmv2.get_aacgm_coord_arr(self.lat_in[0], self.lon_in[0], |
| 466 |
|
[3000.0], self.dtime, |
| 467 |
|
self.method) |
| 468 |
|
|
| 469 |
|
assert len(self.out) == len(self.ref) |
| 470 |
|
assert [isinstance(oo, list) and len(oo) == 1 for oo in self.out] |
| 471 |
|
|
| 472 |
|
self.ref = [64.34650424987989, 83.30339395305012, 0.3307388620896745] |
| 473 |
|
for i, oo in enumerate(self.out): |
| 474 |
|
np.testing.assert_allclose(oo, self.ref[i], rtol=self.rtol) |
| 475 |
|
|
| 476 |
|
def test_get_aacgm_coord_arr_location_failure(self): |
| 477 |
|
"""Test array AACGMV2 calculation with a bad location""" |
|
@@ 213-224 (lines=12) @@
|
| 210 |
|
for i, oo in enumerate(self.out): |
| 211 |
|
np.testing.assert_allclose(oo, [self.ref[i]], rtol=self.rtol) |
| 212 |
|
|
| 213 |
|
def test_convert_latlon_arr_badidea_trace(self): |
| 214 |
|
"""Test array latlon conversion for BADIDEA with trace""" |
| 215 |
|
self.method = "G2A | BADIDEA | TRACE" |
| 216 |
|
self.ref = [69.317391, 85.099499, 2.09726] |
| 217 |
|
self.out = aacgmv2.convert_latlon_arr(self.lat_in[0], self.lon_in[0], |
| 218 |
|
[7000], self.dtime, self.method) |
| 219 |
|
|
| 220 |
|
assert len(self.out) == len(self.ref) |
| 221 |
|
assert [isinstance(oo, list) and len(oo) == 1 for oo in self.out] |
| 222 |
|
|
| 223 |
|
for i, oo in enumerate(self.out): |
| 224 |
|
np.testing.assert_allclose(oo, [self.ref[i]], rtol=self.rtol) |
| 225 |
|
|
| 226 |
|
def test_convert_latlon_arr_location_failure(self): |
| 227 |
|
"""Test array latlon conversion with a bad location""" |
|
@@ 200-211 (lines=12) @@
|
| 197 |
|
0, 300, self.dtime) |
| 198 |
|
|
| 199 |
|
|
| 200 |
|
def test_convert_latlon_arr_badidea(self): |
| 201 |
|
"""Test array latlon conversion for BADIDEA""" |
| 202 |
|
self.method = "G2A | BADIDEA" |
| 203 |
|
self.ref = [64.35677791, 83.30272053, 1.46944431] |
| 204 |
|
self.out = aacgmv2.convert_latlon_arr(self.lat_in[0], self.lon_in[0], |
| 205 |
|
[3000], self.dtime, self.method) |
| 206 |
|
|
| 207 |
|
assert len(self.out) == len(self.ref) |
| 208 |
|
assert [isinstance(oo, list) and len(oo) == 1 for oo in self.out] |
| 209 |
|
|
| 210 |
|
for i, oo in enumerate(self.out): |
| 211 |
|
np.testing.assert_allclose(oo, [self.ref[i]], rtol=self.rtol) |
| 212 |
|
|
| 213 |
|
def test_convert_latlon_arr_badidea_trace(self): |
| 214 |
|
"""Test array latlon conversion for BADIDEA with trace""" |