本文整理汇总了Python中apexpy.Apex.apex2geo方法的典型用法代码示例。如果您正苦于以下问题:Python Apex.apex2geo方法的具体用法?Python Apex.apex2geo怎么用?Python Apex.apex2geo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类apexpy.Apex
的用法示例。
在下文中一共展示了Apex.apex2geo方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_apex2geo_invalid_lat
# 需要导入模块: from apexpy import Apex [as 别名]
# 或者: from apexpy.Apex import apex2geo [as 别名]
def test_apex2geo_invalid_lat():
A = Apex(date=2000, refh=300)
with pytest.raises(ValueError):
A.apex2geo(91, 0, 0, 1e-2)
with pytest.raises(ValueError):
A.apex2geo(-91, 0, 0, 1e-2)
A.apex2geo(90, 0, 0, 1e-2)
A.apex2geo(-90, 0, 0, 1e-2)
assert_allclose(A.apex2geo(90+1e-5, 0, 0, 1e-2), A.apex2geo(90, 0, 0, 1e-2), rtol=0, atol=1e-8)
示例2: test_apex2geo
# 需要导入模块: from apexpy import Apex [as 别名]
# 或者: from apexpy.Apex import apex2geo [as 别名]
def test_apex2geo():
A = Apex(date=2000, refh=300)
lat, lon, error = A.apex2geo(60, 15, 100, precision=1e-2)
assert_allclose((lat, lon, error),
A.qd2geo(*A.apex2qd(60, 15, 100), height=100, precision=1e-2))
assert type(lat) != np.ndarray
assert type(lon) != np.ndarray
assert type(error) != np.ndarray
示例3: test_basevectors_apex_scalar_apex
# 需要导入模块: from apexpy import Apex [as 别名]
# 或者: from apexpy.Apex import apex2geo [as 别名]
def test_basevectors_apex_scalar_apex():
A = Apex(date=2000, refh=300)
f1, f2, f3, g1, g2, g3, d1, d2, d3, e1, e2, e3 = A.basevectors_apex(60, 15, 100, coords='apex', precision=1e-2)
glat, glon, _ = A.apex2geo(60, 15, 100, precision=1e-2)
_, _, _, _, f1_, f2_, _, d1_, d2_, d3_, _, e1_, e2_, e3_ = A._geo2apexall(glat, glon, 100)
assert_allclose(f1, f1_)
assert_allclose(f2, f2_)
assert_allclose(d1, d1_)
assert_allclose(d2, d2_)
assert_allclose(d3, d3_)
assert_allclose(e1, e1_)
assert_allclose(e2, e2_)
assert_allclose(e3, e3_)
示例4: test_basevectors_qd_scalar_apex
# 需要导入模块: from apexpy import Apex [as 别名]
# 或者: from apexpy.Apex import apex2geo [as 别名]
def test_basevectors_qd_scalar_apex():
A = Apex(date=2000, refh=300)
glat, glon, _ = A.apex2geo(60, 15, 100, precision=1e-2)
assert_allclose(A.basevectors_qd(60, 15, 100, coords='apex', precision=1e-2), A._basevec(glat, glon, 100))
示例5: test_apex2geo_vectorization
# 需要导入模块: from apexpy import Apex [as 别名]
# 或者: from apexpy.Apex import apex2geo [as 别名]
def test_apex2geo_vectorization():
A = Apex(date=2000, refh=300)
assert A.apex2geo([60, 60], 15, 100)[0].shape == (2,)
assert A.apex2geo(60, [15, 15], 100)[0].shape == (2,)
assert A.apex2geo(60, 15, [100, 100])[0].shape == (2,)
示例6: test_convert_mlt2geo
# 需要导入模块: from apexpy import Apex [as 别名]
# 或者: from apexpy.Apex import apex2geo [as 别名]
def test_convert_mlt2geo():
datetime = dt.datetime(2000, 3, 9, 14, 25, 58)
A = Apex(date=2000, refh=300)
assert_allclose(A.convert(60, 15, 'mlt', 'geo', height=100, datetime=datetime, precision=1e-2, ssheight=2e5), A.apex2geo(60, A.mlt2mlon(15, datetime, ssheight=2e5), 100, precision=1e-2)[:-1])
示例7: test_convert_apex2geo
# 需要导入模块: from apexpy import Apex [as 别名]
# 或者: from apexpy.Apex import apex2geo [as 别名]
def test_convert_apex2geo():
A = Apex(date=2000, refh=300)
assert_allclose(A.convert(60, 15, 'apex', 'geo', height=100, precision=1e-2), A.apex2geo(60, 15, 100, precision=1e-2)[:-1])