argopy.stores.httpstore.open_dataset#
- httpstore.open_dataset(url: str, errors: Literal['raise', 'ignore', 'silent'] = 'raise', lazy: bool = False, dwn_opts: dict = {}, xr_opts: dict = {}, **kwargs) Dataset [source]#
Create a
xarray.Dataset
from an url pointing to a netcdf file- Parameters:
url (str) β The remote URL of the netcdf file to open
errors (Literal, default:
raise
) β- Define how to handle errors raised during data fetching:
raise
(default): Raise any error encounteredignore
: Do not stop processing, simply issue a debug message in logging consolesilent
: Do not stop processing and do not issue log message
lazy (bool, default=False) β
Define if we should try to load netcdf file lazily or not
- If this is set to False (default) opening is done in 2 steps:
Download from
url
raw binary data withhttpstore.download_url
,Create a
xarray.Dataset
withxarray.open_dataset()
.
Each functions can be passed specifics arguments with
dwn_opts
andxr_opts
(see below).If this is set to True, use a
ArgoKerchunker
instance to access the netcdf file lazily. You can provide a specificArgoKerchunker
instance with theak
argument (see below).dwn_opts (dict, default={}) β Options passed to
httpstore.download_url()
xr_opts (dict, default={}) β Options passed to
xarray.open_dataset()
ak (
ArgoKerchunker
, optional) βArgoKerchunker
instance to use iflazy=True
.akoverwrite (bool, optional) β Determine if kerchunk data should be overwritten or not. This is passed to
ArgoKerchunker.to_kerchunk()
.
- Return type:
- Raises:
TypeError β Raised if data returned by
url
are not CDF or HDF5 binary data.DataNotFound β Raised if
errors
is set toraise
and url returns no data.
See also