I often finding myself wanting basic information about netCDF files and needing to inspect it in Python quickly.
I’ve written a bash function that takes a passed path of a netCDF file, it then writes a short python script and loads it into a ipython console. The console then prints out basic information about the file and all the variable names, ready for you to hack away!
For this bash function you’ll need:
- python 2.x
- python netCDF4 library
- ipython
Here’s the function:
The above is a GitHub gists, feel free to comment/fork/pull! If you’ve found this handy, you might also like my Vim and UltiSnip for similar stuff.
In category: python