polaris.ocean.viz.compute_transect
- polaris.ocean.viz.compute_transect(x, y, ds_horiz_mesh, layer_thickness, bottom_depth, min_level_cell, max_level_cell, spherical=False)[source]
build a sequence of quads showing the transect intersecting mpas cells. This can be used to plot transects of fields with dimensions
nCells
andnVertLevels
usingpolaris.ocean.viz.plot_transect()
- Parameters:
x (xarray.DataArray) – The x or longitude coordinate of the transect
y (xarray.DataArray) – The y or latitude coordinate of the transect
ds_horiz_mesh (xarray.Dataset) – The horizontal MPAS mesh to use for plotting
layer_thickness (xarray.DataArray) – The layer thickness at a particular instant in time. layerThickness.isel(Time=tidx) to select a particular time index tidx if the original data array contains Time.
bottom_depth (xarray.DataArray) – the (positive down) depth of the seafloor on the MPAS mesh
min_level_cell (xarray.DataArray) – the vertical zero-based index of the sea surface on the MPAS mesh
max_level_cell (xarray.DataArray) – the vertical zero-based index of the bathymetry on the MPAS mesh
spherical (bool, optional) – Whether the x and y coordinates are latitude and longitude in degrees
- Returns:
ds_transect (xarray.Dataset) – The transect dataset, see
polaris.ocean.viz.transect.vert.find_transect_levels_and_weights()
for details