- xcdat.open_dataset(path, data_var=None, add_bounds=['X', 'Y'], decode_times=True, center_times=False, lon_orient=None, **kwargs)#
xarray.open_dataset()with post-processing options.
Deprecated since version v0.6.0:
add_boundsboolean arguments (True/False) are being deprecated. Please use either a list (e.g., [“X”, “Y”]) to specify axes or
DataStore) – Strings and Path objects are interpreted as a path to a netCDF file or an OpenDAP URL and opened with python-netCDF4, unless the filename ends with .gz, in which case the file is gunzipped and opened with scipy.io.netcdf (only netCDF3 supported). Byte-strings or file-like objects are opened by scipy.io.netcdf (netCDF3) or h5py (netCDF4/HDF).
Optional[str], optional) – The key of the non-bounds data variable to keep in the Dataset, alongside any existing bounds data variables, by default None.
List[CFAxisKey] | None | bool) – List of CF axes to try to add bounds for (if missing), by default [“X”, “Y”]. Set to None to not add any missing bounds. Please note that bounds are required for many xCDAT features.
This parameter calls
Supported CF axes include “X”, “Y”, “Z”, and “T”
By default, missing “T” bounds are generated using the time frequency of the coordinates. If desired, refer to
xarray.Dataset.bounds.add_time_bounds()if you require more granular configuration for how “T” bounds are generated.
bool, optional) – If True, attempt to decode times encoded in the standard NetCDF datetime format into cftime.datetime objects. Otherwise, leave them encoded as numbers. This keyword may not be supported by all the backends, by default True.
bool, optional) – If True, attempt to center time coordinates using the midpoint between its upper and lower bounds. Otherwise, use the provided time coordinates, by default False.
float]], optional) – The orientation to use for the Dataset’s longitude axis (if it exists). Either (-180, 180) or (0, 360), by default None. Supported options include:
None: use the current orientation (if the longitude axis exists)
(-180, 180): represents [-180, 180) in math notation
(0, 360): represents [0, 360) in math notation
Any]) – Additional arguments passed on to
xarray.open_dataset. Refer to the 1 xarray docs for accepted keyword arguments.
xr.Dataset– Dataset after applying operations.
xarray.open_datasetopens the file with read-only access. When you modify values of a Dataset, even one linked to files on disk, only the in-memory copy you are manipulating in xarray is modified: the original file on disk is never touched.