xray.open_dataset

xray.open_dataset(nc, decode_cf=True, mask_and_scale=True, decode_times=True, concat_characters=True, *args, **kwargs)

Load a dataset from a file or file-like object.

Parameters:

nc : str or file

Path to a netCDF4 file or an OpenDAP URL (opened with python-netCDF4) or a file object or string serialization of a netCDF3 file (opened with scipy.io.netcdf). If the filename ends with .gz, the file is gunzipped

decode_cf : bool, optional

Whether to decode these variables, assuming they were saved according to CF conventions.

mask_and_scale : bool, optional

If True, replace array values equal to _FillValue with NA and scale values according to the formula original_values * scale_factor + add_offset, where _FillValue, scale_factor and add_offset are taken from variable attributes (if they exist).

decode_times : bool, optional

If True, decode times encoded in the standard NetCDF datetime format into datetime objects. Otherwise, leave them encoded as numbers.

concat_characters : bool, optional

If True, concatenate along the last dimension of character arrays to form string arrays. Dimensions will only be concatenated over (and removed) if they have no corresponding variable and if they are only used as the last dimension of character arrays.

*args, **kwargs : optional

Format specific loading options passed on to the datastore.

Returns:

dataset : Dataset

The newly created dataset.