mpas_tools.ocean.viz.transect.compute_transect

mpas_tools.ocean.viz.transect.compute_transect(x, y, ds_horiz_mesh, layer_thickness, bottom_depth, min_level_cell, max_level_cell, spherical=False, z_transect=None)[source]

build a sequence of quads showing the transect intersecting mpas cells. This can be used to plot transects of fields with dimensions nCells and either nVertLevels (levels) or nVertLevelsP1 (interfaces).

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

  • z_transect (xarray.DataArray, optional) – the z coordinate of the transect (1D or 2D). If 2D, it must have the same along-transect dimension as x and y

Returns:

ds_transect (xarray.Dataset) – The transect dataset, see mpas_tools.ocean.viz.transect.vert.find_transect_levels_and_weights() for details