from scipy.io import netcdf import sys f = netcdf.netcdf_file(sys.argv[1], "r") print f.dimensions # dictionary of dimensions for v in f.variables: # f.variables is a dictionary print v # iterate over the keys which are strings rzV = f.variables["pout_psiRZ"] # get item for the key rzData = rzV.data # get data of variable print rzV.shape print rzV.units rz0 = rzData[0][:][:] # take first 2-D slice; time step 0 import matplotlib.pyplot as plt plt.contourf(rz0) plt.show()