- 积分
- 824
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2017-2-23
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 百雀羚口服 于 2021-3-27 13:40 编辑
读取的是190-230E的数据,海温场能够正常绘制,但风场却画到了10-50E的位置,求指教
U=w['u'][26::2,:,:].mean(dim='time').sel(latitude=slice(20,10),longitude=slice(190,230))
V=w['v'][26::2,:,:].mean(dim='time').sel(latitude=slice(20,10),longitude=slice(190,230))
SST=sst['sst'][26::2,:,:].mean(dim='time').sel(latitude=slice(20,10),longitude=slice(190,230))
lon=U['longitude']
lat=V['latitude']
proj=ccrs.PlateCarree(central_longitude=180)
datacrs=ccrs.PlateCarree()
fig1=plt.figure(figsize=(12,8),dpi=500)
ax1=fig1.add_axes([0.1,0.1,0.6,0.6],projection=proj)
ax1.coastlines(lw=0.6)
ax1.set_xticks(np.arange(0,361,60),crs=ccrs.PlateCarree())
ax1.set_yticks(np.arange(-90,90,20),crs=ccrs.PlateCarree())
ax1.xaxis.set_major_formatter(LongitudeFormatter())
ax1.yaxis.set_major_formatter(LatitudeFormatter())
ax1.set_extent([0,250,0,50], crs=ccrs.PlateCarree())
ax1.set_title('(a) Jul(5 months before)',loc='left')
ax1.contourf(lon,lat,SST,np.arange(295,302,0.3),cmap=plt.get_cmap('RdBu_r'),extend='both',transform=datacrs)
q=ax1.quiver(lon[::20],lat[::20],U[::20,::20],V[::20,::20],pivot='mid',scale=40,scale_units='inches',width=0.0018,headwidth=4)
ax1.quiverkey(q,0.95,0.1,5,r'$5 \frac{m}{s}$',labelpos='W')
codes=[Path.MOVETO,Path.LINETO,Path.LINETO,Path.LINETO,Path.CLOSEPOLY,]
vertices=[(10,10),(10,20),(50,20),(50,10),(0,0)]
path=Path(vertices,codes)
patch=patches.PathPatch(path,facecolor='NONE',edgecolor='k',ls='-',lw=1)
ax1.add_patch(patch)
|
|