data0.verify_dataset ==================== .. py:module:: data0.verify_dataset Functions --------- .. autoapisummary:: data0.verify_dataset.verify_dataset data0.verify_dataset.verify_var data0.verify_dataset.fuzzy_coord_match Module Contents --------------- .. py:function:: verify_dataset(xr_dataset, check_time=True, shift_lons=False, **kwargs) Verify that the given xarray dataset is valid. Check to make sure the given dataset is of the expected type and contains the expected coordinates. :param xr_dataset: The xarray data to verify. :type xr_dataset: `xarray.Dataset` or `xarray.DataArray` :param check_time: If True, verify that the dataset has a 'time' coordinate. :type check_time: `bool`, optional :param shift_lons: If True, shift the longitude values based on the PM_centered kwarg. :type shift_lons: `bool`, optional :param \*\*kwargs: Additional keyword arguments to pass to `shift_lon_arr()`. :type \*\*kwargs: keyword arguments :returns: **xr_dataset** -- The verified xarray dataset. :rtype: `xarray.Dataset` or `xarray.DataArray` .. py:function:: verify_var(xr_dataset, var) Verify that the given variable is in the given xarray dataset. :param xr_dataset: The xarray data to verify. :type xr_dataset: `xarray.Dataset` or `xarray.DataArray` :param var: The variable name to verify. :type var: `str` :returns: True if the variable is in the dataset, otherwise raises a ValueError. :rtype: `bool` .. py:function:: fuzzy_coord_match(coord) Return standard coordinate name for given fuzzy match. Take in a coordinate name which may be a variation of standard coordinate names (e.g., 'lat', 'latitude', 'Latitude') and returns the standard coordinate name ('lat', 'lon', 'time') for latitude, longitude, and time. Also returns the dummy 'number' coordinate from ERA5 data. :param coord: The coordinate name to match. :type coord: `str` :returns: **matched_coord** -- The standard coordinate name that matches the input coordinate. :rtype: `str` .. rubric:: Examples >>> fuzzy_coord_match('lat') 'lat' >>> fuzzy_coord_match('latitude') 'lat' >>> fuzzy_coord_match('Latitude') 'lat'