iconarray.backend.grid.open_dataset#
- iconarray.backend.grid.open_dataset(file, variable=None, decode_cf=True, decode_coords='all', decode_times=True, backend_kwargs=None, **kwargs)#
Open either NETCDF or GRIB file.
Returning either an xarray.Dataset, or a list of xarray.Datasets if the data in the GRIB file cannot be represented as a single hypercube (see ecmwf/cfgrib for more info)
- Parameters:
file (
Path
) – Path to ICON data file, either NETCDF of GRIB format.variable (
str
, optional) – Name of variable to return from filtered dataset. Defaults to None.decode_cf (
bool
, optional) – Whether to decode these variables, assuming they were saved according to CF conventions. Defaults to True.decode_coords (
bool
or{"coordinates", "all"}
, optional) – Controls which variables are set as coordinate variables (see xarray documentation for open_dataset). Defaults to “all”.decode_times (
bool
, optional) – If True, decode times encoded in the standard NetCDF datetime format into datetime objects. Otherwise, leave them encoded as numbers. Defaults to True.backend_kwargs (
dict
, optional) – Additional keyword arguments passed on to cfgrib.**kwargs (
dict
, optional) – Additional keyword arguments passed on to the xarray engine open function.
- Returns:
ds (
xarray.Dataset
orList(xarray.Datasets)
)- Raises:
TypeError – If datatype is neither identified as GRIB or NETCDF.
See also
iconarray.backend