[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[python #UNG-652401]: MetPy Mondays #164 - (MetPy 1.0 XArray Basics with the GFS): Unable to open netCDF stream
- Subject: [python #UNG-652401]: MetPy Mondays #164 - (MetPy 1.0 XArray Basics with the GFS): Unable to open netCDF stream
- Date: Mon, 27 Sep 2021 14:33:54 -0600
Hello! Thanks for reaching out, and thanks for providing helpful information.
Unfortunately, I don't have a concrete solution to your problem. This is
something I am not able to recreate locally with your provided notebooks and
environment information. We can try a few things here to get a better idea of
where this is coming from.
Just in case there are some package issues in your base environment, let's
start with a fresh install of only the tools we need to reproduce this:
conda create -n test-env -c conda-forge jupyterlab metpy siphon
conda activate test-env
jupyter lab
and then give your notebook another try. If you're still getting an error, then
follow back up with me and let me know the error, as well as the output from
`conda list` once again!
Some other things we can check out if you're still getting this error. From
your command-line (within your environment!):
nc-config --version --prefix --has-dap2
ncdump -h
'https://thredds.ucar.edu/thredds/dodsC/grib/NCEP/GFS/Global_0p25deg/Best'
and let me know the output of nc-config and if ncdump works in reaching this
file for you. These can tell us if something is in the wrong place
behind-the-scenes with netcdf, or if there might be some other reason you can't
access this OPeNDAP link.
Separately, back in your notebook we can give an explicit try with the
CDMRemote protocol on THREDDS:
from siphon.catalog import TDSCatalog
import xarray as xr
url =
('https://thredds.ucar.edu/thredds/catalog/grib/NCEP/GFS/Global_0p25deg/catalog.xml')
cat = TDSCatalog(url)
d = cat.datasets['Best GFS Quarter Degree Forecast Time Series']
ds = d.remote_access(service='CDMRemote', use_xarray=True)
ds
and let me know if that works. Finally, for some people, shrinking the cache of
file-like objects for xarray might help:
import xarray as xr
xr.set_options(file_cache_maxsize=10)
. . . # (remainder of your notebook)
Hopefully this is just an issue in your base environment, but don't hesitate to
follow up with the results of this testing so that we can find a solution!
All the best,
Drew
> Unfortunately, by following the 'MetPy Mondays session #164' (MetPy 1.0
> XArray Basics with the GFS) I steadily encounter some error to open the
> netCDF data stream.
> The finally returned error message is
> "[Errno -68] NetCDF: I/O failure:
> b'https://thredds.ucar.edu/thredds/dodsC/grib/NCEP/GFS/Global_0p25deg/Best'"
>
> I tried opening the netCDF data stream by using any of the THREDDS access
> protocols available (OPENDAP,WCS,WMS,...), but none of them worked.
> The error occurs on both Windows 10 x64 and Linux (Linux Mint 20.2). On Linux
> there's an additional curl error (Unsupported protocol).
>
Ticket Details
===================
Ticket ID: UNG-652401
Department: Support Python
Priority: Low
Status: Closed
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata
inquiry tracking system and then made publicly available through the web. If
you do not want to have your interactions made available in this way, you must
let us know in each email you send to us.