Python:从 shapefile(多边形/多重多边形)中屏蔽 ERA5 数据(NetCDF)
我想从瑞士北部和南部地理掩码(加上雷达缓冲区)内的 ERA5 网格数据(仅表面水平)中选择网格单元,以计算区域平均值。 4 个遮罩 (遮罩) 以多边形/多多边形 (多边形) 在 shapefile 中,到目前为止,对于 2 个蒙版,我能够使用 salem roi得到我想要的:
radar_north = salem.read_shapefile('radar_north140.shp')
file_radar_north = file.salem.roi(shape=radar_north)
file_radar_north.cape.mean(dim='time').salem.quick_map()
但是,对于radar_south和alpensuedseite形状文件,代码一开始不起作用(错误选择或不显示数据),现在什么也不起作用了(?)。我不知道为什么,因为从第一次到第二次我没有改变任何东西。
如果有人看到这个问题或知道屏蔽 ERA 数据的不同方法(可能更快),我将不胜感激! (我在这里没有成功地回答类似问题)。
最好的 莉娜
I want to select grid cells from ERA5 gridded data (surface level only) that are inside geographical masks for North- and South-Switzerland (plus the radar buffer), to calculate regional means.
The 4 masks (masks) are given as polygons/multipolygons (polygons) in a shapefile and so far for 2 of the masks I was able to use salem roi to get what I want:
radar_north = salem.read_shapefile('radar_north140.shp')
file_radar_north = file.salem.roi(shape=radar_north)
file_radar_north.cape.mean(dim='time').salem.quick_map()
However, for the radar_south and alpensuedseite shapefiles the code didn´t work at the beginning (wrong selection or shows no data), and now the nothing works anymore (?). I don´t know why, as I have not changed anything from the first time to the second.
If someone sees the issue or knows a different way to mask the ERA data (which is maybe quicker) I would be grateful! (I was unsuccessfull with the answers from similar questions here).
Best
Lena
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您正在处理NETCDF文件,这可能会起作用
This could work if you are working on netcdf files