cs_tgt = iris.coord_systems.GeogCS(iris.analysis.cartography.DEFAULT_SPHERICAL_EARTH_RADIUS)
# Again, convert it to a cartopy projection
cs_tgt_cart = cs_tgt.as_cartopy_projection()
最后,使用cartopy的变换方法将本机投影中的二维坐标数组转换为目标投影中的坐标
lons, lats, _ = cs_tgt_cart.transform_points(cs_nat_cart, xx, yy).T
# Note the transpose at the end.
如果只想变换x坐标和y坐标以绘制数据,可以使用
iris
和cartopy
:首先,获取本机投影中的坐标点
接下来,制作一对具有相同形状的二维阵列
然后提取本机投影并将其转换为
cartopy
投影:接下来,创建目标投影,例如标准椭球投影
最后,使用
cartopy
的变换方法将本机投影中的二维坐标数组转换为目标投影中的坐标还要注意,上面的函数总是返回
z
坐标数组,但在本例中为0然后,您可以使用
lons
和lats
在谷歌地图或其他应用程序中绘制数据。请记住,这些新坐标是曲线的,所以实际上必须是二维阵列但是,如果要在
iris
(和matplotlib
)中绘制数据,可以通过以下方式进行:希望这有帮助
相关问题 更多 >
编程相关推荐