problem with netCDF4 OpenDAP
Jason Swails
jason.swails at gmail.com
Thu Aug 13 11:55:49 EDT 2015
On Thu, Aug 13, 2015 at 6:32 AM, Tom P <werotizy at 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'
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20150813/d4931614/attachment.html>
More information about the Python-list
mailing list