#!/usr/bin/env python #------------- # Load modules #------------- from netCDF4 import Dataset #------------------ # Opening the file #------------------ ncFid = Dataset('myFile.nc4', mode='r') #--------------------- # Extracting variables #--------------------- time = ncFid.variables['time'][:] lev = ncFid.variables['lev'][:] lat = ncFid.variables['lat'][:] lon = ncFid.variables['lon'][:] temp = ncFid.variables['temp'][:] #----------------- # Closing the file #----------------- ncFid.close()