在Python中使用“Cartopy”时如何使用提供的“PROJ4字符串”?

问题描述 投票:0回答:1

我有海冰浓度值,x和y以米为单位(3个具有相同维度的向量),并且我有PROJ4字符串:“北半球:+proj=stere +lat_0=90 +lat_ts=70 +lon_0=- 45 +k=1 +x_0=0 +y_0=0 +a=6378273 +b=6356889.449 +单位=m +no_defs"。

如何在Python中绘制它(x和y以米为单位)?我如何知道应该使用哪个 projectionCRS?我写了这段代码,但它不能正常工作:

ax = fig.add_subplot(1,1,1, projection=crs.NorthPolarStereo(central_longitude=0))
ax.add_feature(cfeature.COASTLINE)
ax.add_feature(cfeature.LAND, color="black", alpha=0.5)
ax.add_feature(cfeature.OCEAN, color="white", alpha=0.3)
kw = dict(central_latitude=0, central_longitude=0)
sc = plt.scatter(x_coords, y_coords, c=values, cmap='jet', s=10,
            transform=crs.Stereographic(**kw))
cbar = plt.colorbar()
ax.gridlines(crs=crs.PlateCarree(), draw_labels=True,
                  linewidth=0.1, color='gray', alpha=0.5, linestyle='--')
plt.show()
python projection cartopy coordinate-transformation proj4js
1个回答
0
投票
问:我应该使用哪种投影和 CRS?
A: NorthPolarStereo() 具有适当的选项,试试这个
NorthPolarStereo(central_longitude=-45, true_scale_latitude=70)
© www.soinside.com 2019 - 2024. All rights reserved.