Path: csiph.com!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: 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 In-Reply-To: Date: Fri, 14 Aug 2015 09:15:17 -0400 Cc: python-list@python.org Content-Transfer-Encoding: quoted-printable References: To: Tom P 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 > On Aug 14, 2015, at 3:18 AM, Tom P wrote: >=20 > Thanks for the reply but that is not what the documentation says. >=20 > 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).=E2=80=9D =E2=80=8BHuh, 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/e= rsst.201507.nc') syntax error, unexpected WORD_WORD, expecting SCAN_ATTR or SCAN_DATASET = or SCAN_ERROR context: 404 Not Found

Not = Found

The requested URL = /pub/data/cmb/ersst/v3b/netcdf/ersst.201507.nc.dds was not found on this = server.

Traceback (most recent call last): File "", line 1, in File "netCDF4/_netCDF4.pyx", line 1547, in = netCDF4._netCDF4.Dataset.__init__ (netCDF4/_netCDF4.c:9551) RuntimeError: NetCDF: file not found So it=E2=80=99s clear that netCDF4 is at least *trying* to go online to = look for the file, but it simply can=E2=80=99t find it. Since the docs = say it=E2=80=99s 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=E2=80=99s more, it *seems* like the = file (/pub/.../ersst.201507.nc.dds) was decorated with the =E2=80=98.dds=E2= =80=99 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 >=20 > 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" >=20 > --=20 > https://mail.python.org/mailman/listinfo/python-list -- Jason M. Swails BioMaPS, Rutgers University Postdoctoral Researcher