title: netcdf4 extract for subset of lat lon
body: <p>I would like to extract a spatial subset of a rather large netcdf file. From <a href="https://stackoverflow.com/questions/18665078/loop-through-netcdf-files-and-run-calculations-python-or-r">Loop through netcdf files and run calculations - Python or R</a> </p>
  
  <pre><code>from pylab import *
  import netCDF4
  
  f = netCDF4.MFDataset('/usgs/data2/rsignell/models/ncep/narr/air.2m.1989.nc')
  # print variables
  f.variables.keys()
  atemp = f.variables['air'] # TODO: extract spatial subset
  </code></pre>
  
  <p>How do I extract just the subset of netcdf file corresponding to a state (say Iowa). Iowa has following boundary lat lon:</p>
  
  <p>Longitude: 89° 5' W to 96° 31' W</p>
  
  <p>Latitude: 40° 36' N to 43° 30' N</p>