如何使用Metpy.interpaly从一组数据中插值温度
我正在尝试使用Cartopy
和Metpy.interpaly
生成地图,我希望最终产品与下面的图片相似从ndawn网站拍摄的图像。我有一组具有坐标和温度的数据(LAT,LON,TEMP):
lat:[49.8134,49.8134,49.8134,49.8134,49.8134,49.8134,49.8134,49.8134, 49.8134,49.8134,49.8134]
lon:[-100.3721,-100.3721,-100.3721,-100.3721,-100.3721, -100.3721,-100.3721,-100.3721,-100.3721,-100.3721]
tem:[-8.45,-4.026,-5.993,-3.68,-7.35,-7.421,-6.477,-8.03,-8.03, -3.834,-13.04]
我正在尝试插入温度并使用Contourf
将其抽出。但是,我不知道如何使用Metpy的插值
函数将它们插入。有人可以帮忙吗?
I'm trying to generate a map using cartopy
and metpy.interpolate
, and I want the final products to be similar to this picture below Image taken from NDAWN website. I have a set of data with coordinate and temperature (lat, lon, temp):
lat: [49.8134, 49.8134, 49.8134, 49.8134, 49.8134, 49.8134, 49.8134,
49.8134, 49.8134, 49.8134]lon: [-100.3721, -100.3721, -100.3721, -100.3721, -100.3721,
-100.3721, -100.3721, -100.3721, -100.3721, -100.3721]tem: [-8.45, -4.026, -5.993, -3.68, -7.35, -7.421, -6.477, -8.03,
-3.834, -13.04]
I'm trying to interpolate the temperature and use contourf
to draw it out. However, I have no idea how to interpolate them using metpy's interpolation
function. Can someone please help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个例子。我必须从上面更改LAT/LON值,因为这是一个仅在上面重复的点(您无法插入
的插件:
有关更多信息,我建议您查找更多信息at 在METPY文档中此示例
的,因为间距不相等
M从LAT/LON中转换为LAT/LON,因为用度插值是有问题 在调用
transform_points()
的调用中,使用platecarree()
是您与造型的传达方式,所给出的坐标为LON/LAT坐标。Here's an example. I had to change the lat/lon values from above since that is a single point only repeated above (which you can't interpo
which yields:
For more information I'd suggest looking at this example in the MetPy documentation.
EDIT: I'm transforming the coordinates from lat/lon in degrees because interpolating with degrees is problematic since the spacing isn't equal. So I transform to a projected coordinate system, which gives us an even spacing and I can request the grid spacing of 5km.
The use of
PlateCarree()
in the call totransform_points()
is how you communicate to Cartopy that the coordinates being given are lon/lat coordinates.