最近在利用python下载SWOT数据时出现以下的问题:
import xarray as xr
import s3fs
import cartopy.crs as ccrs
from matplotlib import pyplot as plt
import earthaccess
from earthaccess import Auth, DataCollections, DataGranules, Store
import os
os.environ['PROJ_DATA'] = '/opt/anaconda3/share/proj'
plt.figure(figsize=(15, 5))
ax = plt.axes(projection=ccrs.PlateCarree())
ax.set_global()
# ds.ssha_karin_corrected.plot.pcolormesh(
# ax=ax, transform=ccrs.PlateCarree(), x="longitude", y="latitude", vmin = -1, vmax=1, cmap='coolwarm', add_colorbar=True)
ax.coastlines()

首次要查看自己mac的/opt/anaconda3/share路径中是否存在proj库,如果没有则需要重新安装。
解决办法:重新安装proj库
conda install pyproj
重新查看目录下出现proj:

接着即可运行代码:

❤️欢迎点赞收藏❤️