gridmarthe.slice_cross_section
- gridmarthe.slice_cross_section(grid, x=None, y=None, agg_along_axis=None)[source]
grid needs geom infos and to have x,y as dimension. See
gridmarthe.compute_geometry()andgridmarthe.assign_coords()- Parameters:
- grid: xarray.Dataset
Dataset with geometry infos, x,y as dimensions.
- x, yfloat, optional
Coordinates on which search for cross section transect.
- agg_along_axisstr, optional
If not None, aggregate along axis (mean). Accepted values are ‘x’ or ‘y’.
- Returns:
- xr.Dataset
Dataset for cross section transect.
Examples
>>> geom = gm.compute_geometry(topo, hsub, mask.zone) >>> ds_2d = gm.assign_coords(geom) >>> ds_xsection = slice_cross_section(ds_2d, x=6.116e5)