在Barbs中使用transform_first关键字

发布于 2025-01-16 02:35:27 字数 291 浏览 0 评论 0原文

我正在尝试从 HRRR 模型中绘制风倒钩,而倒钩大约需要 58-63 秒图中的 50-55 秒。我注意到倒刺没有“transform_first”关键字,那么有没有其他方法可以加速倒刺?

ax1.barbs(x,y,uwind,vwind,length=5,regrid_shape=15,color='black',alpha=0.6,transform=ccrs.PlateCarree())

regrid_shape = 12 只是稍微快一点。
我专门寻找速度。

I am trying to plot wind barbs from the HRRR model and Barbs takes about 50-55 seconds of the 58-63 second plot. I noticed that barbs doesnt have the "transform_first" keyword, so is there an alternative way to speed up barbs?

ax1.barbs(x,y,uwind,vwind,length=5,regrid_shape=15,color='black',alpha=0.6,transform=ccrs.PlateCarree())

regrid_shape = 12 is only mildly faster.
Im looking specifically for speed.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

送你一个梦 2025-01-23 02:35:27

事实证明 regrid_shape 非常昂贵;所以我只是删除了 regrid_shape 关键字。我手动稀疏阵列以获得更好的性能。

ax1.barbs(x[::60,::60],y[::60,::60],uwind[::60,::60],vwind[::60,::60],length=5,color='black',alpha=0.6,transform=ccrs.PlateCarree())

regrid_shape 还映射到 cartopy 贴图的“范围”,而不是模型网格空间。这样做是完全有意义的,因此要小心可能与您的地图范围不太匹配的区域模型。

Turns out that regrid_shape is very expensive; so i just removed regrid_shape keyword. I manually thinned the arrays for better performance.

ax1.barbs(x[::60,::60],y[::60,::60],uwind[::60,::60],vwind[::60,::60],length=5,color='black',alpha=0.6,transform=ccrs.PlateCarree())

regrid_shape also maps to the "extent" of the cartopy map, not to the model grid space. It makes total sense to do that, so be careful for regional models that may not quite match your map extent.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文