本文整理汇总了Python中apexpy.Apex.map_V_to_height方法的典型用法代码示例。如果您正苦于以下问题:Python Apex.map_V_to_height方法的具体用法?Python Apex.map_V_to_height怎么用?Python Apex.map_V_to_height使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类apexpy.Apex
的用法示例。
在下文中一共展示了Apex.map_V_to_height方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_map_V_to_height
# 需要导入模块: from apexpy import Apex [as 别名]
# 或者: from apexpy.Apex import map_V_to_height [as 别名]
def test_map_V_to_height():
A = Apex(date=2000, refh=300)
out_60_15_100_500 = [0.819719, 2.845114, 0.695437]
out_60_15_100_500_234 = [1.830277, 4.14345, 0.947624]
out_60_15_100_1000 = [0.924577, 3.149964, 0.851343]
out_60_15_200_500 = [0.803882, 2.793206, 0.682839]
out_60_30_100_500 = [0.761412, 2.878837, 0.736549]
out_70_15_100_500 = [0.846819, 2.592572, 0.347919]
# scalar
assert_allclose(A.map_V_to_height(60, 15, 100, 500, [1, 2, 3]), out_60_15_100_500, rtol=1e-5)
assert_allclose(A.map_V_to_height(60, 15, 100, 500, [2, 3, 4]), out_60_15_100_500_234, rtol=1e-5)
assert_allclose(A.map_V_to_height(60, 15, 100, 1000, [1, 2, 3]), out_60_15_100_1000, rtol=1e-5)
assert_allclose(A.map_V_to_height(60, 15, 200, 500, [1, 2, 3]), out_60_15_200_500, rtol=1e-5)
assert_allclose(A.map_V_to_height(60, 30, 100, 500, [1, 2, 3]), out_60_30_100_500, rtol=1e-5)
assert_allclose(A.map_V_to_height(70, 15, 100, 500, [1, 2, 3]), out_70_15_100_500, rtol=1e-5)
# vectorize lat
assert_allclose(A.map_V_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_V_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_V_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_V_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_V_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)