Metpy 横截面测地线

Metpy Cross Section Geodesic

我这里可能问错了问题,远不是问题专家,但是在创建横截面时,是否可以遵循等向线?该文档指出它通过规则网格上的给定数据沿测地线获取垂直横截面切片。这似乎表明它将遵循大循环。

或者,这都是在调用横截面方法之前将我的数据放在某个投影中的问题吗?如果是这样,Metpy 中是否有任何设施可以做到这一点?我在其他 SO 搜索中找到了一些想法。

这些是我的横截面之一的纬度坐标。 我真正想要的是背阔肌保持不变。

From: (40.05, -80) lat, lon
To: (40.05, 20.06)

[40.05       40.49129217 40.92753221 41.35857652 41.78427825 42.20448739
 42.6190507  43.02781183 43.43061131 43.8272866  44.21767222 44.60159979
 44.97889817 45.34939353 45.71290958 46.06926767 46.41828699 46.75978478
 47.09357658 47.41947646 47.73729732 48.04685118 48.34794952 48.64040361
 48.92402495 49.19862562 49.46401872 49.72001885 49.96644255 50.20310884
 50.42983969 50.64646057 50.85280099 51.04869508 51.23398211 51.40850708
 51.5721213  51.72468292 51.86605751 51.99611856 52.11474806 52.22183695
 52.31728562 52.40100434 52.47291364 52.53294472 52.58103974 52.61715208
 52.64124659 52.65329974 52.65329974 52.64124659 52.61715208 52.58103974
 52.53294472 52.47291364 52.40100434 52.31728562 52.22183695 52.11474806
 51.99611856 51.86605751 51.72468292 51.5721213  51.40850708 51.23398211
 51.04869508 50.85280099 50.64646057 50.42983969 50.20310884 49.96644255
 49.72001885 49.46401872 49.19862562 48.92402495 48.64040361 48.34794952
 48.04685118 47.73729732 47.41947646 47.09357658 46.75978478 46.41828699
 46.06926767 45.71290958 45.34939353 44.97889817 44.60159979 44.21767222
 43.8272866  43.43061131 43.02781183 42.6190507  42.20448739 41.78427825
 41.35857652 40.92753221 40.49129217 40.05      ]

MetPy's cross_section currently only computes geodesic/great circle paths between starting and ending lat/lon points to use for the vertical cross section. To use an alternative path (such as a rhumb line), the underlying interpolate_to_slice 函数可用于数据集水平维度坐标中的点数组。例如,假设您的数据是一维 lat/lon 坐标(即等距柱状投影),您的示例变为

start_lat, start_lon = (40.05, -80)
end_lat, end_lon = (40.05, 20.06)
n_points = 100

lats = np.linspace(start_lat, end_lat, n_points)
lons = np.linspace(start_lon, end_lon, n_points)

cross = interpolate_to_slice(data, np.stack([lons, lats], axis=1))

如果您的数据在其他投影上,您将需要获取正确转换的坐标并使用它们。