本文整理汇总了Python中apexpy.Apex.map_E_to_height方法的典型用法代码示例。如果您正苦于以下问题:Python Apex.map_E_to_height方法的具体用法?Python Apex.map_E_to_height怎么用?Python Apex.map_E_to_height使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类apexpy.Apex
的用法示例。
在下文中一共展示了Apex.map_E_to_height方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_map_E_to_height
# 需要导入模块: from apexpy import Apex [as 别名]
# 或者: from apexpy.Apex import map_E_to_height [as 别名]
def test_map_E_to_height():
A = Apex(date=2000, refh=300)
out_60_15_100_500 = [0.7115211, 2.3562392, 0.57259707]
out_60_15_100_500_234 = [1.560284, 3.439154, 0.782339]
out_60_15_100_1000 = [0.677964, 2.089811, 0.558601]
out_60_15_200_500 = [0.723773, 2.427366, 0.590826]
out_60_30_100_500 = [0.686265, 2.375296, 0.600594]
out_70_15_100_500 = [0.727605, 2.180817, 0.291414]
# scalar
assert_allclose(A.map_E_to_height(60, 15, 100, 500, [1, 2, 3]), out_60_15_100_500, rtol=1e-5)
assert_allclose(A.map_E_to_height(60, 15, 100, 500, [2, 3, 4]), out_60_15_100_500_234, rtol=1e-5)
assert_allclose(A.map_E_to_height(60, 15, 100, 1000, [1, 2, 3]), out_60_15_100_1000, rtol=1e-5)
assert_allclose(A.map_E_to_height(60, 15, 200, 500, [1, 2, 3]), out_60_15_200_500, rtol=1e-5)
assert_allclose(A.map_E_to_height(60, 30, 100, 500, [1, 2, 3]), out_60_30_100_500, rtol=1e-5)
assert_allclose(A.map_E_to_height(70, 15, 100, 500, [1, 2, 3]), out_70_15_100_500, rtol=1e-5)
# vectorize lat
assert_allclose(A.map_E_to_height([60, 70], 15, 100, 500, np.array([[1, 2, 3]]*2).T),
np.array([out_60_15_100_500, out_70_15_100_500]).T, rtol=1e-5)
# vectorize lon
assert_allclose(A.map_E_to_height(60, [15, 30], 100, 500, np.array([[1, 2, 3]]*2).T),
np.array([out_60_15_100_500, out_60_30_100_500]).T, rtol=1e-5)
# vectorize height
assert_allclose(A.map_E_to_height(60, 15, [100, 200], 500, np.array([[1, 2, 3]]*2).T),
np.array([out_60_15_100_500, out_60_15_200_500]).T, rtol=1e-5)
# vectorize newheight
assert_allclose(A.map_E_to_height(60, 15, 100, [500, 1000], np.array([[1, 2, 3]]*2).T),
np.array([out_60_15_100_500, out_60_15_100_1000]).T, rtol=1e-5)
# vectorize E
assert_allclose(A.map_E_to_height(60, 15, 100, 500, np.array([[1, 2, 3], [2, 3, 4]]).T),
np.array([out_60_15_100_500, out_60_15_100_500_234]).T, rtol=1e-5)