wakatools.base.DataFrameAccessor.get_raster_values#

DataFrameAccessor.get_raster_values(raster: DataArray) ndarray[source]#

Read raster values from a given xarray DataArray nearest to the “x” and “y” coordinates in the DataFrame. This assumes that the raster’s coordinates are in the same coordinate reference system as the DataFrame coordinates.

Parameters:

raster (xr.DataArray) – The raster DataArray from which to read values.

Returns:

An array of raster values corresponding to the DataFrame coordinates.

Return type:

np.ndarray