Coverage for stems/xarray_accessor.py : 96%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
""" Extend XArray with the ``.stems`` XArray accessor [1]_
References ---------- .. [1] http://xarray.pydata.org/en/stable/internals.html#extending-xarray
"""
""" Base class for xarray.DataArray and xarray.Dataset accessors """
""" Apply georeferencing to XArray data
Parameters ---------- crs : rasterio.crs.CRS Rasterio CRS transform : affine.Affine Affine transform of the data grid_mapping : str, optional Name to use for grid mapping variable
Returns ------- xarray.Dataset or xarray.DataArray Georeferenced data """ grid_mapping=grid_mapping, inplace=False)
""" Check if data is georeferenced
Returns ------- bool True if XArray data is georeferenced """
def coord_x(self): """ np.ndarray: X coordinates """
def coord_y(self): """ np.ndarray: Y coordinates """
def crs(self): """ rasterio.crs.CRS: Coordinate reference system """ # TODO: parse based on CF information, not just GDAL
def transform(self): """ affine.Affine: Affine transform """ # TODO: assume unique -> yes if 2D, otherwise no
else: 'Assuming coordinates are NOT unique')
assume_unique=assume_unique)
def bounds(self): """ BoundingBox: Bounding box of data """ assume_unique=assume_unique)
def bbox(self): """ Polygon: Bounding box polygon """
def grid_mapping(self): """ xarray.DataArray: Georeferencing variable """ self._obj, grid_mapping=self._grid_mapping ) except KeyError as ke: raise KeyError('XArray data object is not georeferenced') else:
""" XArray.DataArray accessor for STEMS project """
""" XArray.Dataset accessor for STEMS project """ |