xarray.Dataset.hyoga.profile#
- Dataset.hyoga.profile(datasource, interval=None)#
Interpolate onto coordinates along a profile.
- Parameters:
datasource (sequence,
array
,GeoDataFrame
,str
,Path
or file-like) – Sequence of (x, y) coordinate tuples, (N, 2) coordinate array, GeoDataFrame or path to a shapefile containing a single line, along which the dataset will be interpolated.interval (
float
, optional) – If provided, resample (linearly interpolate) profile coordinates to a fixed spatial resolution given byinterval
. IfNone
, the data are interpolated to the exactdatasource
coordinate, which may produce an irreguar grid.
- Returns:
dataset (
Dataset
) – The interpolated dataset, where horizontal dimensionsx
andy
are replaced by a new dimensiond
with a grid spacing of eitherinterval
or the distance between points indatasource
.