title: Read a netcdf file on an ftp server with python
body: <p>I need to access a netcdf file, which is stored on a remote ftp server. I could easily download it and read it from my local disk. But the files are very big and there are very many of them. So downloading them all would take about ten days. Since I only need a part of the data from the netcdf files, I am looking for a way to read the file without downloading it before.
  I have tried working with ftplib, but that package seems to offer only functions to download the file. So I came to urllib.
  I thought something like the following code would work, but it doesn't.</p>
  
  <pre><code>import urllib.request
  from netCDF4 import Dataset
  
  path = "Core/GLOBAL_REANALYSIS_PHYS_001_017/global-reanalysis-phys-001-017
          ...-ran-uk-orap5.0-gridt"
  filename = "votemper_ORAP5.0_1m_197901_grid_T_02.nc"
  
  req = urllib.request.Request("ftp:// username:pwd@rancmems.mercator-ocean.fr/"
        ...+path+"/"+filename)
  
  fid = Dataset(req, 'r')
  print(fid.variables.keys())
  </code></pre>
  
  <p>I get the error message "OSError: No such file or directory". So I don't have access to the netcdf file. 
  Is there a way to solve the problem?</p>
  
  <p>Thanks for suggestions!</p>