argopy.stores.ftpstore.open_dataset#
- ftpstore.open_dataset(url: str, errors: Literal['raise', 'ignore', 'silent'] = 'raise', lazy: bool = False, xr_opts: dict = {}, **kwargs)[source]#
Create a
xarray.Datasetfrom 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
urlraw binary data withftpstore.fs.cat_file,Create a
xarray.Datasetwithxarray.open_dataset().
Each functions can be passed specifics arguments with
dwn_optsandxr_opts(see below).If this is set to True, use a
ArgoKerchunkerinstance to access the netcdf file lazily. You can provide a specificArgoKerchunkerinstance with theakargument (see below).xr_opts (dict, default={}) β Options passed to
xarray.open_dataset(). This will be ignored if the ``netCDF4` option is set to True.ak (
ArgoKerchunker, optional) βArgoKerchunkerinstance to use iflazy=True.akoverwrite (bool, optional) β Determine if kerchunk data should be overwritten or not. This is passed to
ArgoKerchunker.to_kerchunk().netCDF4 (bool, optional, default=False) β Return a
netCDF4.Datasetobject instead of axarray.Dataset
- Return type:
xarray.DatasetornetCDF4.Dataset- Raises:
TypeError β Raised if data returned by
urlare not CDF or HDF5 binary data.DataNotFound β Raised if
errorsis set toraiseand url returns no data.
See also