本文整理汇总了Python中apexpy.Apex.apex2qd方法的典型用法代码示例。如果您正苦于以下问题:Python Apex.apex2qd方法的具体用法?Python Apex.apex2qd怎么用?Python Apex.apex2qd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类apexpy.Apex
的用法示例。
在下文中一共展示了Apex.apex2qd方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_apex2qd_invalid_lat
# 需要导入模块: from apexpy import Apex [as 别名]
# 或者: from apexpy.Apex import apex2qd [as 别名]
def test_apex2qd_invalid_lat():
A = Apex(date=2000, refh=300)
with pytest.raises(ValueError):
A.apex2qd(91, 0, 0)
with pytest.raises(ValueError):
A.apex2qd(-91, 0, 0)
A.apex2qd(90, 0, 0)
A.apex2qd(-90, 0, 0)
assert_allclose(A.apex2qd(90+1e-5, 0, 0), A.apex2qd(90, 0, 0), rtol=0, atol=1e-8)
示例2: test_apex2qd
# 需要导入模块: from apexpy import Apex [as 别名]
# 或者: from apexpy.Apex import apex2qd [as 别名]
def test_apex2qd():
A = Apex(date=2000, refh=300)
lat, lon = A.apex2qd(60, 15, 100)
assert_allclose((lat, lon),
[60.498401, 15])
assert type(lat) != np.ndarray
assert type(lon) != np.ndarray
示例3: test_apex2geo
# 需要导入模块: from apexpy import Apex [as 别名]
# 或者: from apexpy.Apex import apex2qd [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
示例4: test_apex2qd_apexheight_over
# 需要导入模块: from apexpy import Apex [as 别名]
# 或者: from apexpy.Apex import apex2qd [as 别名]
def test_apex2qd_apexheight_over():
A = Apex(date=2000, refh=300)
with pytest.raises(ApexHeightError):
A.apex2qd(0, 15, 301)
示例5: test_apex2qd_apexheight_close
# 需要导入模块: from apexpy import Apex [as 别名]
# 或者: from apexpy.Apex import apex2qd [as 别名]
def test_apex2qd_apexheight_close():
A = Apex(date=2000, refh=300)
A.apex2qd(0, 15, 300+1e-6)
示例6: test_apex2qd_vectorization
# 需要导入模块: from apexpy import Apex [as 别名]
# 或者: from apexpy.Apex import apex2qd [as 别名]
def test_apex2qd_vectorization():
A = Apex(date=2000, refh=300)
assert A.apex2qd([60, 60], 15, 100)[0].shape == (2,)
assert A.apex2qd(60, [15, 15], 100)[0].shape == (2,)
assert A.apex2qd(60, 15, [100, 100])[0].shape == (2,)
示例7: test_convert_mlt2qd
# 需要导入模块: from apexpy import Apex [as 别名]
# 或者: from apexpy.Apex import apex2qd [as 别名]
def test_convert_mlt2qd():
datetime = dt.datetime(2000, 3, 9, 14, 25, 58)
A = Apex(date=2000, refh=300)
assert_allclose(A.convert(60, 15, 'mlt', 'qd', height=100, datetime=datetime, ssheight=2e5), A.apex2qd(60, A.mlt2mlon(15, datetime, ssheight=2e5), height=100))
示例8: test_convert_apex2qd
# 需要导入模块: from apexpy import Apex [as 别名]
# 或者: from apexpy.Apex import apex2qd [as 别名]
def test_convert_apex2qd():
A = Apex(date=2000, refh=300)
assert_allclose(A.convert(60, 15, 'apex', 'qd', height=100), A.apex2qd(60, 15, height=100))