pyorc.Velocimetry.get_transect#

Velocimetry.get_transect(x, y, z=None, s=None, crs=None, v_eff=True, xs='xs', ys='ys', distance=None, wdw=1, wdw_x_min=None, wdw_x_max=None, wdw_y_min=None, wdw_y_max=None, rolling=None, tolerance=0.5, quantiles=[0.05, 0.25, 0.5, 0.75, 0.95])[source]#

Interpolate all variables to supplied x and y coordinates of a cross section. This function assumes that the grid can be rotated and that xs and ys are supplied following the projected coordinates supplied in “xs” and “ys” coordinate variables in ds. x-coordinates and y-coordinates that fall outside the domain of ds, are still stored in the result for further interpolation or extrapolation. Original coordinate values supplied are stored in coordinates “x”, “y” and (if supplied) “z”. Time series are transformed to set quantiles.

Parameters:
  • x (tuple or list-like) – x-coordinates on which interpolation should be done

  • y (tuple or list-like) – y-coordinates on which interpolation should be done

  • z (tuple or list-like) – z-coordinates on which interpolation should be done, defaults: None

  • s (tuple or list-like) – distance from bank coordinates on which interpolation should be done, defaults: None if set, these distances will be precisely respected, and not interpolated. distance will be ignored.

  • crs (int, dict or str, optional) – coordinate reference system (e.g. EPSG code) in which x, y and z are measured (default: None), None assumes crs is the same as crs of xr.Dataset.

  • v_eff (boolean, optional) – if True (default), effective velocity (perpendicular to cross-section) is also computed

  • xs (str, optional) – name of variable that stores the x coordinates in the projection in which “x” is supplied (default: “xs”)

  • ys (str, optional) – name of variable that stores the y coordinates in the projection in which “y” is supplied (default: “ys”)

  • distance (float, optional) – sampling distance over the cross-section in [m]. the bathymetry points will be interpolated to match this distance. If not set, the distance will be estimated from the velocimetry grid resolution. (default: None)

  • wdw (int, optional) – window size to use for sampling the velocity. zero means, only cell itself, 1 means 3x3 window. (default: 1) wdw is used to fill wdw_x_min and wdwd_y_min with its negative (-wdw) value, and wdw_y_min and wdw_y_max with its positive value, to create a sampling window.

  • wdw_x_min (int, optional) – window size in negative x-direction of grid (must be negative), overrules wdw in negative x-direction if set

  • wdw_x_max (int, optional) – window size in positive x-direction of grid, overrules wdw in positive x-direction if set

  • wdw_y_min (int, optional) – window size in negative y-direction of grid (must be negative), overrules wdw in negative y-direction if set

  • wdw_y_max (int, optional) – window size in positive y-direction of grid, overrules wdw in positive x-direction if set.

  • tolerance (float (0-1), optional) – tolerance on the required amount of sampled data in the window defined by wdw and/or wdw_x_min, wdw_x_max, wdw_y_min and wdw_y_max (if set). At least this fraction of cells each time step must have a data value to return a value. Otherwise the location is given a nan as value.

  • rolling (int, optional) – if set other than None (default), a rolling mean over time is applied, before deriving quantile estimates.

  • quantiles (list of floats (0-1), optional) – list of quantiles to return (default: [0.05, 0.25, 0.5, 0.75, 0.95]).

Returns:

ds_points – interpolated data at the supplied x and y coordinates over quantiles

Return type:

xr.Dataset