在windows系统下安装cinrad库,首先需要在激活的环境下运行以下代码:
conda install -c conda-forge cartopy
然后才可以进行安装,否则会报错:
pip install cinrad -i https://pypi.tuna.tsinghua.edu.cn/simple
mac不同于windows系统,在安装cinrad数据库的时候不会出现报错现象,具体安装方法如下:
首先激活anaconda下你需要使用的环境(因个人情况而异),输入:
conda install -c conda-forge cartopy
上面这一步基本上没啥问题,然后是安装cinrad库:
pip install cinrad -i https://pypi.tuna.tsinghua.edu.cn/simple
部分mac用户可能会遇到以下报错:
ERROR: Cannot uninstall 'certifi'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
主要原因在于pip版本过高,需要降低pip版本至9.0.1:
pip install pip==9.0.1
再次运行cinrad库的安装代码即可。
安装完成后可以选择将pip版本安装成最新版:
pip install --upgrade pip
运行cinrad示例代码生成0.5°仰角反射率图片:
from cinrad.visualize import PPI
from cinrad.io import StandardData
f = StandarData(file_path)
ref = f.get_data(0,230,'REF')
fig = PPI(ref)
fig('ref.png')
可能会报以下多种问题:
第一种:
ImportError: DLL load failed while importing _imaging: 找不到指定的模块。
解决方法,降低pillow版本:
pip install pillow==8.4.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
第二种:
ImportError: DLL load failed while importing _network: 找不到指定的模块。
解决方法,降低pyproj版本:
pip install pyproj==3.1.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
第三种:
AttributeError: 'GeoAxes' object has no attribute 'background_patch'
解决方法,更改源码 :
ax.patch.set_visible(False)
第四种:
AttributeError:'GeoAxes' object has no attribute 'outline_patch'
解决方法,更改源码:
ax.spines['geo'].set_visible(False)