Christopher Bull bio photo

Christopher Bull

Aspiring Oceanographer at Northumbria University. Big data python enthusiast. Outdoor adventurer.

Email Twitter Github

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:

  1. python 2.x
  2. python netCDF4 library
  3. 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