An example to read a NetCDF file with Python
For this post I'm going to use this post and the following files as reference.
If you want to see air.sig995.2012.nc content you can try with Integrated Data Viewer (IDV).
To download just execute:
wget https://www.unidata.ucar.edu/downloads/idv/current/ftp/idv_5_5_linux64_installer.sh
bash idv_5_5_linux64_installer.sh
NetCDF files:
Source code:
To download just execute:
wget https://www.unidata.ucar.edu/downloads/idv/current/ftp/idv_5_5_linux64_installer.sh
bash idv_5_5_linux64_installer.sh
Now, execute the python example file:
python netcdf_example.py
You probably will get the following errors:
ImportError: No module named functools_lru_cache
ImportError: No module named basemap
You can install modules from pip, but in my case I can't solve the issue.
To fix it install them from apt as follows:
sudo apt install python-backports.functools-lru-cache
python-mpltoolkits.basemap
Enjoy it!
Comments
Post a Comment