提问者:小点点

卡托莫等值线不环绕经度


我试图用cartopy绘制北极立体投影中的海冰轮廓,但有一种奇怪的行为,即轮廓没有以180度环绕。我看了另一个帖子(在Cartopy极坐标立体图中轮廓的奇怪行为),该帖子建议将我的经度更改为0-360,但如果我这样做,我会遇到相同的问题,但经度是0,而不是180。

(使用相同的数据,我从未使用过basemap)

sea_ice,LO和LA是大小(448,304)的矩阵,最重要的是,LA和LO不是规则间隔的纬度和纬度,它是极投影,所以我不能使用add_cyclic_point。

这是我的绘图代码:

fig = plt.figure(figsize=(8,8))
ax = plt.axes(projection=cartopy.crs.NorthPolarStereo(true_scale_latitude=70))
gl = ax.gridlines(draw_labels=True)
gl.xlabel_style = {'size': 16,'rotation':0}
ax.coastlines('10m')
ax.add_feature(cfeature.RIVERS)
ax.set_extent([-180, 180, 55, 90], crs=cartopy.crs.PlateCarree())
ax.add_feature(cfeature.LAND, facecolor = '0.75')
ax.add_feature(cfeature.RIVERS,facecolor='blue')

cc=plt.contour(LO,LA,sea_ice,levels=[15],colors='m ',linewidth=3,transform = cartopy . CRS . plate carree())

我的经度从-180到180的等高线

我的经度从0°到360°的等高线


共1个答案

匿名用户

我们都使用了相同的NsidC每日数据集。

尝试

ax.contour(xgrid, ygrid, sea_ice, [15], transform=cartopy.crs.epsg(3411))

同意lat、lon和sea_ice是二维的xgrid和ygrid,而不是lat和lon。然后调用特定于数据集的转换epsg标记,聚合建议为3411。

srid:urn:ogc:def:crs:EPSG::3411