我有全球卫星网格降水数据,我可以成功地以圆柱坐标分配到阿拉斯加。小码如下(抱歉没有换行):
mapproj = Basemap(projection = 'cyl', resolution = 'l', llcrnrlat=50.0, llcrnrlon=185.0, urcrnrlat=80.0, urcrnrlon=230.0)
myplot = plt.imshow(datamasked.T, interpolation = 'nearest', cmap = my_cmap, norm = matplotlib.colors.Normalize(vmin = 0.0, vmax = 10.0, clip = False), extent = (0.0, 360.0, -90.0, 90.0))
要获得mercator,我只将相关的代码行更改为
mapproj = Basemap(projection = 'merc', resolution = 'l', llcrnrlat=50.0, llcrnrlon=185.0, urcrnrlat=80.0, urcrnrlon=230.0,lat_0=65.0,lon_0=207.5)
x0, y0 = mapproj(185.0,50.0)
x1, y1 = mapproj(230.0,80.0)
myplot = mapproj.imshow(datamasked.T, interpolation = 'nearest', cmap = my_cmap, \
norm = matplotlib.colors.Normalize(vmin = 0.0, vmax = 10.0, clip = False), \
extent = (x0, x1, y0, y1))
此代码生成的图像是
这显示整个数据集被挤压到阿拉斯加,而不是圆柱投影中的预期子集。圆柱投影中的底图似乎足以指定数据子集。不确定如何在mercator中指定子集。对不起啰嗦的帖子感到抱歉,但我想要彻底。谢谢你的帮助。