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


Groups > comp.lang.python > #95373

Re: problem with netCDF4 OpenDAP

Path csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Tom P <werotizy@freent.dd>
Newsgroups comp.lang.python
Subject Re: problem with netCDF4 OpenDAP
Date Fri, 14 Aug 2015 09:18:54 +0200
Lines 65
Message-ID <d35j2uFp5hdU1@mid.individual.net> (permalink)
References <d33a27F7p5oU1@mid.individual.net> <mailman.169.1439481351.3627.python-list@python.org>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 8bit
X-Trace individual.net MebVRWUWr16cvXeyaqZZ7wyiVbDrS/1dRHHq68ljUweu3F2mo=
Cancel-Lock sha1:lPFIVIUF2TPyz2PCxI5/aQciW2c=
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0
In-Reply-To <mailman.169.1439481351.3627.python-list@python.org>
Xref csiph.com comp.lang.python:95373

Show key headers only | View raw


On 08/13/2015 05:55 PM, Jason Swails wrote:
>
>
> On Thu, Aug 13, 2015 at 6:32 AM, Tom P <werotizy@freent.dd
> <mailto:werotizy@freent.dd>> wrote:
>
>     I'm having a problem trying to access OpenDAP files using netCDF4.
>     The netCDF4 is installed from the Anaconda package. According to
>     their changelog, openDAP is supposed to be supported.
>
>     netCDF4.__version__
>     Out[7]:
>     '1.1.8'
>
>     Here's some code:
>
>     url =
>     'http://www1.ncdc.noaa.gov/pub/data/cmb/ersst/v3b/netcdf/ersst.201507.nc'
>     nc = netCDF4.Dataset(url)
>
>     I get the error -
>     netCDF4/_netCDF4.pyx in netCDF4._netCDF4.Dataset.__init__
>     (netCDF4/_netCDF4.c:9551)()
>
>     RuntimeError: NetCDF: file not found
>
>
>     However if I download the same file, it works -
>     url = '/home/tom/Downloads/ersst.201507.nc <http://ersst.201507.nc>'
>     nc = netCDF4.Dataset(url)
>     print nc
>       . . . .
>
>     Is it something I'm doing wrong?
>
>
> ​Yes.  URLs are not files and cannot be opened like normal files.
>   netCDF4 *requires* a local file as far as I can tell.
>
> All the best,
> Jason
>
> --
> Jason M. Swails
> BioMaPS,
> Rutgers University
> Postdoctoral Researcher

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)."

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"

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