Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #95375

Re: problem with netCDF4 OpenDAP

Path csiph.com!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <jason.swails@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'configure': 0.04; 'constructor': 0.07; 'redirected': 0.07; 'suffix': 0.07; 'tom': 0.07; 'cc:addr:python-list': 0.09; 'filename.': 0.09; 'indeed,': 0.09; 'says.': 0.09; 'unexpected': 0.09; 'url:github': 0.09; 'syntax': 0.13; 'file,': 0.15; '"file': 0.16; '404': 0.16; 'datasets': 0.16; 'packages:': 0.16; 'scipy,': 0.16; 'skip:/ 50': 0.16; 'support)': 0.16; 'url.': 0.16; 'wrote:': 0.16; '>>>': 0.20; '(not': 0.20; 'library': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'aug': 0.20; 'issue.': 0.20; 'suggested': 0.20; '(the': 0.22; '"",': 0.22; 'interpret': 0.22; 'subject:problem': 0.22; 'trying': 0.22; 'cc:no real name:2**0': 0.22; 'am,': 0.23; 'tried': 0.24; '(most': 0.24; 'header:In-Reply- To:1': 0.24; 'linux': 0.26; 'skip:" 20': 0.26; 'error': 0.27; 'least': 0.27; '14,': 0.27; 'url:gov': 0.27; 'skip:( 20': 0.28; 'looks': 0.29; 'it\xe2\x80\x99s': 0.29; 'omitted': 0.29; 'server.': 0.30; 'url:mailman': 0.30; 'option': 0.31; 'says': 0.32; 'though,': 0.32; 'run': 0.33; 'url:python': 0.33; 'http': 0.33; 'traceback': 0.33; 'message-id:@gmail.com': 0.34; 'url:listinfo': 0.34; 'file': 0.34; 'worked': 0.34; 'server': 0.34; 'received:google.com': 0.35; 'skip:( 30': 0.35; 'clear': 0.35; 'jason': 0.35; 'but': 0.36; 'project': 0.36; 'instead': 0.36; 'there': 0.36; 'url:org': 0.36; 'subject:: ': 0.37; 'say': 0.37; 'thanks': 0.37; 'support,': 0.37; '(with': 0.38; 'version': 0.38; 'sure': 0.39; 'received:192': 0.39; 'url:mail': 0.40; 'subject:with': 0.40; 'some': 0.40; 'your': 0.60; 'header:Message- Id:1': 0.61; 'here.': 0.62; 'skip:n 10': 0.62; 'more': 0.63; 'complete': 0.63; 'accessed': 0.66; 'reply': 0.68; 'online': 0.71; 'curl': 0.84; 'highlights:': 0.84; 'url:www1': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Glzdeg+ht7Kfv7oOfSWSR0hYa10EJmDcWP7PjVvenbo=; b=ZuJdWSB/Vq6oLtzloJMwZ+5qtu7O58y3BDY2rL+YbMJQgIlckrJoN3iNq+8frcE0my iRgZQvrc3OPNeovDmLQmPFhTIJbSmWqlJLuMatSkrudjS9xzz6XaIcmfTP8ZYUNYXAAw dHpIB8KjILfEjqCdFaFD5I8oKi+eg029UfeLAevQMc1QXpCdnZEdp1vRiOKXjmGVZIe8 UTgTiMerH9wofugtFcyjELrdTXzajtsFLxhRB301E09x3BwviREkt2hBcw31jtDUzjOd YKplfniGn7pW7/xJ831BSrPAdYiG0Bsb0adYQT6l3l3XpNkrVW490uvMyABytZrYV5Rh VeiQ==
X-Received by 10.140.237.70 with SMTP id i67mr38682112qhc.48.1439558119404; Fri, 14 Aug 2015 06:15:19 -0700 (PDT)
Content-Type text/plain; charset=utf-8
Mime-Version 1.0 (Mac OS X Mail 8.2 \(2102\))
Subject Re: problem with netCDF4 OpenDAP
From Jason Swails <jason.swails@gmail.com>
In-Reply-To <d35j2uFp5hdU1@mid.individual.net>
Date Fri, 14 Aug 2015 09:15:17 -0400
Cc python-list@python.org
Content-Transfer-Encoding quoted-printable
References <d33a27F7p5oU1@mid.individual.net> <mailman.169.1439481351.3627.python-list@python.org> <d35j2uFp5hdU1@mid.individual.net>
To Tom P <werotizy@freent.dd>
X-Mailer Apple Mail (2.2102)
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.9.1439558127.4764.python-list@python.org> (permalink)
Lines 67
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1439558127 news.xs4all.nl 2915 [2001:888:2000:d::a6]:47831
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:95375

Show key headers only | View raw


> On Aug 14, 2015, at 3:18 AM, Tom P <werotizy@freent.dd> wrote:
> 
> Thanks for the reply but that is not what the documentation says.
> 
> http://unidata.github.io/netcdf4-python/#section8
> "Remote OPeNDAP-hosted datasets can be accessed for reading over http if a URL is provided to the netCDF4.Dataset constructor instead of a filename. However, this requires that the netCDF library be built with OPenDAP support, via the --enable-dap configure option (added in version 4.0.1).”

​Huh, so it does.  Your error message says "file not found", though, which suggested to me that it's trying to interpret the NetCDF file as a local file instead of a URL.  Indeed, when I run that example, the traceback is more complete (the traceback you printed had omitted some information):

>>> netCDF4.Dataset('http://www1.ncdc.noaa.gov/pub/data/cmb/ersst/v3b/netcdf/ersst.201507.nc')
syntax error, unexpected WORD_WORD, expecting SCAN_ATTR or SCAN_DATASET or SCAN_ERROR
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>
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "netCDF4/_netCDF4.pyx", line 1547, in netCDF4._netCDF4.Dataset.__init__ (netCDF4/_netCDF4.c:9551)
RuntimeError: NetCDF: file not found

So it’s clear that netCDF4 is at least *trying* to go online to look for the file, but it simply can’t find it.  Since the docs say it’s linking to libcurl, I tried using curl to download the file (curl -# http://www1.ncdc.noaa.gov/pub/data/cmb/ersst/v3b/netcdf/ersst.201507.nc > test.nc) and it worked fine.  What’s more, it *seems* like the file (/pub/.../ersst.201507.nc.dds) was decorated with the ‘.dds’ suffix for some reason (not sure if the server redirected the request there or not).  But this looks like a netCDF4 issue.  Perhaps you can go to their project page on Github and file an issue there -- they will be more likely to have your answer than people here.

HTH,
Jason

> 
> and for the Anaconda package -
> http://docs.continuum.io/anaconda/changelog
> "2013-05-08: 1.5.0:
> Highlights:
>  updates to all important packages: python, numpy, scipy, ipython, matplotlib, pandas, cython
>  added netCDF4 (with OpenDAP support) on Linux and MacOSX"
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

--
Jason M. Swails
BioMaPS,
Rutgers University
Postdoctoral Researcher

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

problem with netCDF4 OpenDAP Tom P <werotizy@freent.dd> - 2015-08-13 12:32 +0200
  Re: problem with netCDF4 OpenDAP Tom P <werotizy@freent.dd> - 2015-08-14 09:18 +0200
    Re: problem with netCDF4 OpenDAP Jason Swails <jason.swails@gmail.com> - 2015-08-14 09:15 -0400
      Re: problem with netCDF4 OpenDAP Tom P <werotizy@freent.dd> - 2015-08-14 17:26 +0200
        Re: problem with netCDF4 OpenDAP Michael Ströder <michael@stroeder.com> - 2015-08-15 02:02 +0200

csiph-web