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.

NetCDF files:
Source code:


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


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

Popular posts from this blog

Exception: Could not find a default OpenFlow controller in Mininet

How to fix Android when developer options are not available for this user

Webcam streaming throught VLC with YUY2 compatibility