本文整理汇总了Python中apexpy.Apex._geo2apex方法的典型用法代码示例。如果您正苦于以下问题:Python Apex._geo2apex方法的具体用法?Python Apex._geo2apex怎么用?Python Apex._geo2apex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类apexpy.Apex
的用法示例。
在下文中一共展示了Apex._geo2apex方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test__geo2apex_longitude
# 需要导入模块: from apexpy import Apex [as 别名]
# 或者: from apexpy.Apex import _geo2apex [as 别名]
def test__geo2apex_longitude():
A = Apex(date=2000, refh=300)
assert_allclose(A._geo2apex(60, 180, 100), fa.apxg2all(60, 180, 100, 300, 0)[2:4])
assert_allclose(A._geo2apex(60, -180, 100), fa.apxg2all(60, -180, 100, 300, 0)[2:4])
assert_allclose(A._geo2apex(60, -180, 100), A._geo2apex(60, 180, 100))
for i in range(-5, 5):
for lat in [0, 30, 60, 90]:
assert_allclose(A._geo2apex(lat, 15+i*360, 100), fa.apxg2all(lat, 15, 100, 300, 0)[2:4])
示例2: test_set_refh
# 需要导入模块: from apexpy import Apex [as 别名]
# 或者: from apexpy.Apex import _geo2apex [as 别名]
def test_set_refh():
A = Apex(date=2000, refh=300)
assert A.refh, 300
ret_300 = A._geo2apex(60, 15, 100)
A.set_refh(500)
assert A.refh == 500
ret_500 = A._geo2apex(60, 15, 100)
assert_allclose(ret_300, fa.apxg2all(60, 15, 100, 300, 0)[2:4])
assert_allclose(ret_500, fa.apxg2all(60, 15, 100, 500, 0)[2:4])
示例3: test__geo2apex_array
# 需要导入模块: from apexpy import Apex [as 别名]
# 或者: from apexpy.Apex import _geo2apex [as 别名]
def test__geo2apex_array():
A = Apex(date=2000, refh=300)
lats, lons = A._geo2apex([[0, 30], [60, 90]], 15, [[100, 200], [300, 400]])
lat1, lon1 = fa.apxg2all(0, 15, 100, 300, 0)[2:4]
lat2, lon2 = fa.apxg2all(30, 15, 200, 300, 0)[2:4]
lat3, lon3 = fa.apxg2all(60, 15, 300, 300, 0)[2:4]
lat4, lon4 = fa.apxg2all(90, 15, 400, 300, 0)[2:4]
assert_allclose(lats.astype(float), np.array([[lat1, lat2], [lat3, lat4]], dtype=float))
assert_allclose(lons.astype(float), np.array([[lon1, lon2], [lon3, lon4]], dtype=float))
示例4: test_set_epoch
# 需要导入模块: from apexpy import Apex [as 别名]
# 或者: from apexpy.Apex import _geo2apex [as 别名]
def test_set_epoch():
A = Apex(date=2000.2, refh=300)
assert_allclose(A.year, 2000.2)
ret_2000_2_py = A._geo2apex(60, 15, 100)
A.set_epoch(2000.8)
assert_allclose(A.year, 2000.8)
ret_2000_8_py = A._geo2apex(60, 15, 100)
assert ret_2000_2_py != ret_2000_8_py
fa.loadapxsh(A.datafile, 2000.2)
ret_2000_2_apex = fa.apxg2all(60, 15, 100, 300, 0)[2:4]
fa.loadapxsh(A.datafile, 2000.8)
ret_2000_8_apex = fa.apxg2all(60, 15, 100, 300, 0)[2:4]
assert ret_2000_2_apex != ret_2000_8_apex
assert_allclose(ret_2000_2_py, ret_2000_2_apex)
assert_allclose(ret_2000_8_py, ret_2000_8_apex)
示例5: test__geo2apex_scalar
# 需要导入模块: from apexpy import Apex [as 别名]
# 或者: from apexpy.Apex import _geo2apex [as 别名]
def test__geo2apex_scalar():
A = Apex(date=2000, refh=300)
for lat in [0, 30, 60, 89]:
for lon in [-179, -90, 0, 90, 180]:
assert_allclose(A._geo2apex(lat, lon, 100), fa.apxg2all(lat, lon, 100, 300, 0)[2:4])
示例6: test_geo2apex
# 需要导入模块: from apexpy import Apex [as 别名]
# 或者: from apexpy.Apex import _geo2apex [as 别名]
def test_geo2apex():
A = Apex(date=2000, refh=300)
lat, lon = A.geo2apex(60, 15, 100)
assert_allclose((lat, lon), A._geo2apex(60, 15, 100))
assert type(lat) != np.ndarray
assert type(lon) != np.ndarray