英文:
Gridding data to edge of bounds
问题
我有一些mesonet站点的散点数据,想要为特定变量生成地图。我首先想要对数据进行网格化并将其存储在NetCDF中以便重复访问。我正在使用metpy来生成经纬度/变量的网格:
interpolate_to_grid(X, Y, Z, interp_type="natural_neighbor", hres=0.125, boundary_coords={'west': -120., 'south': 33., 'east': -90., 'north': 53.})
该变量的散点数据未覆盖整个州(示例在爱荷华州),图像中显示了空洞。
当我从网格化的数据生成图像时,它不会插值到边缘。
是否有办法让metpy.interpolate_to_grid将数据网格化到边缘?
英文:
I have some scatter data of mesonet stations and I want to generate maps for a specific variable. I first want to grid the data and store it in a NetCDF for repeated access. I'm using metpy to generate the grids for the lat/lon/variable:
interpolate_to_grid(X, Y, Z, interp_type="natural_neighbor", hres=0.125, boundary_coords={'west': -120., 'south': 33., 'east': -90., 'north': 53.})
The scatter data for this variable does not cover the whole state (the example is in Iowa), there are holes shown in the image below.
When I generate an image from the gridded data It does not interpolate to the edge.
Is there a way to get metpy.interpolate_to_grid to grid the data to the edge of the bounds?
答案1
得分: 0
不使用自然邻近插值。您所看到的区域是您的数据所知的“凸包”。基本上,要对网格点进行插值,该点需要被数据“包围”。其他方法,如线性插值或距离加权方法,将为您提供不同的有效数据界限。
英文:
Not with natural neighbor interpolation. The area you see is what's known as the "convex hull" of your data. Essentially, to interpolate to a grid point, that point needs to be "surrounded" by data. Other methods, like the linear interpolation, or the distance-weighting methods, will give you a different bound of valid data.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论