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