<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <blockquote type="cite">
      <table class="header-part1" cellpadding="0" cellspacing="0"
        border="0" width="100%">
        <tbody>
          <tr>
            <td>
              <div class="headerdisplayname" style="display:inline;">Subject:
              </div>
              problem with netCDF4 OpenDAP</td>
          </tr>
          <tr>
            <td>
              <div class="headerdisplayname" style="display:inline;">From:
              </div>
              Tom P <a class="moz-txt-link-rfc2396E" href="mailto:werotizy@freent.dd"><werotizy@freent.dd></a></td>
          </tr>
          <tr>
            <td>
              <div class="headerdisplayname" style="display:inline;">Date:
              </div>
              08/13/2015 10:32 AM</td>
          </tr>
        </tbody>
      </table>
      <table class="header-part2" cellpadding="0" cellspacing="0"
        border="0" width="100%">
        <tbody>
          <tr>
            <td>
              <div class="headerdisplayname" style="display:inline;">To:
              </div>
              <a class="moz-txt-link-abbreviated" href="mailto:python-list@python.org">python-list@python.org</a></td>
          </tr>
        </tbody>
      </table>
      <br>
      I'm having a problem trying to access OpenDAP files using netCDF4.
      <br>
      The netCDF4 is installed from the Anaconda package. According to
      their changelog, openDAP is supposed to be supported.
      <br>
      <br>
      netCDF4.__version__
      <br>
      Out[7]:
      <br>
      '1.1.8'
      <br>
      <br>
      Here's some code:
      <br>
      <br>
      url = '<a class="moz-txt-link-freetext"
href="http://www1.ncdc.noaa.gov/pub/data/cmb/ersst/v3b/netcdf/ersst.201507.nc">http://www1.ncdc.noaa.gov/pub/data/cmb/ersst/v3b/netcdf/ersst.201507.nc</a>'
      <br>
      nc = netCDF4.Dataset(url)
      <br>
      <br>
      I get the error -
      <br>
      netCDF4/_netCDF4.pyx in netCDF4._netCDF4.Dataset.__init__
      (netCDF4/_netCDF4.c:9551)()
      <br>
      <br>
      RuntimeError: NetCDF: file not found
      <br>
      <br>
      <br>
      However if I download the same file, it works -
      <br>
      url = '/home/tom/Downloads/ersst.201507.nc'
      <br>
      nc = netCDF4.Dataset(url)
      <br>
      print nc
      <br>
       . . . .
      <br>
      <br>
      Is it something I'm doing wrong?
      <br>
    </blockquote>
    Same thing here:<br>
    <br>
    (devenv-3.4.1) dilbert@gtrojan> python<br>
    Python 3.4.1 (default, Jul  7 2014, 15:47:25) <br>
    [GCC 4.8.3 20140624 (Red Hat 4.8.3-1)] on linux<br>
    Type "help", "copyright", "credits" or "license" for more
    information.<br>
    >>> import netCDF4<br>
    >>> url =
    '<a class="moz-txt-link-freetext" href="http://www1.ncdc.noaa.gov/pub/data/cmb/ersst/v3b/netcdf/ersst.201507.nc">http://www1.ncdc.noaa.gov/pub/data/cmb/ersst/v3b/netcdf/ersst.201507.nc</a>'
    <br>
    >>> nc = netCDF4.Dataset(url) <br>
    syntax error, unexpected WORD_WORD, expecting SCAN_ATTR or
    SCAN_DATASET or SCAN_ERROR<br>
    context: <!DOCTYPE^ HTML PUBLIC "-//IETF//DTD HTML
    2.0//EN"><html><head><title>404 Not
    Found</title></head><body><h1>Not
    Found</h1><p>The requested URL
    /pub/data/cmb/ersst/v3b/netcdf/ersst.201507.nc.dds was not found on
    this server.</p></body></html><br>
    Traceback (most recent call last):<br>
      File "<stdin>", line 1, in <module><br>
      File "netCDF4.pyx", line 1466, in netCDF4.Dataset.__init__
    (netCDF4.c:19738)<br>
    RuntimeError: NetCDF: file not found<br>
    >>><br>
    <br>
    It looks like NCDC does not support OpeNDAP (note the .dds extension
    in the error message). It is not a Python/netCDF4 issue.<br>
    <br>
    (devenv-3.4.1) dilbert@gtrojan> ncdump -h
    <a class="moz-txt-link-freetext" href="http://www1.ncdc.noaa.gov/pub/data/cmb/ersst/v3b/netcdf/ersst.201507.nc">http://www1.ncdc.noaa.gov/pub/data/cmb/ersst/v3b/netcdf/ersst.201507.nc</a><br>
    syntax error, unexpected WORD_WORD, expecting SCAN_ATTR or
    SCAN_DATASET or SCAN_ERROR<br>
    context: <!DOCTYPE^ HTML PUBLIC "-//IETF//DTD HTML
    2.0//EN"><html><head><title>404 Not
    Found</title></head><body><h1>Not
    Found</h1><p>The requested URL
    /pub/data/cmb/ersst/v3b/netcdf/ersst.201507.nc.dds was not found on
    this server.</p></body></html><br>
    ncdump:
    <a class="moz-txt-link-freetext" href="http://www1.ncdc.noaa.gov/pub/data/cmb/ersst/v3b/netcdf/ersst.201507.nc">http://www1.ncdc.noaa.gov/pub/data/cmb/ersst/v3b/netcdf/ersst.201507.nc</a>:
    NetCDF: file not found<br>
    <br>
    <br>
    George<br>
    <br>
  </body>
</html>