matplotlib和cartopy的边问题

2024-04-29 15:49:13 发布

您现在位置:Python中文网/ 问答频道 /正文

我试着用matplotlib和cartopy把哨兵图像放在一起。它基本上起作用了,相反,边缘是模糊的,就像这样: enter image description here

print('globe')
north_crs = ccrs.NorthPolarStereo()
north_globe = ccrs.Globe(semiminor_axis=90)
north_xform_crs = ccrs.Geodetic(globe=north_globe)
colorlists = [None] * len(file_paths)
lonslist = [None] * len(file_paths)
latslist = [None] * len(file_paths)

fig = plt.figure()
GeoAxes._pcolormesh_patched = Axes.pcolormesh
ax = plt.axes(projection=north_crs)
ax.coastlines()
data = np.zeros([image_pixel, image_pixel], dtype=np.uint8)
GeoAxes._pcolormesh_patched = Axes.pcolormesh

for i in range(len(file_paths)):
    print(f'file #{i}')
    color_list, lons, lats = getInfos(file_paths[i], north_crs, north_xform_crs)
    colorlists[i] = color_list
    lonslist[i] = lons
    latslist[i] = lats
    ax.pcolormesh(lons, lats, data, transform=north_crs, color=color_list)

我试过把矩阵放进一个。成功了。但是每一张哨兵图像都是10980*10980,我不认为我的电脑或者我可以访问的服务器能够处理这么多的数据来给我一张北极的图像


Tags: 图像imagenonelenaxlistfilecolor