polaris.ocean.viz.transect.vert.find_transect_levels_and_weights

polaris.ocean.viz.transect.vert.find_transect_levels_and_weights(ds_horiz_transect, layer_thickness, bottom_depth, min_level_cell, max_level_cell)[source]

Construct a vertical coordinate for a transect produced by polaris.ocean.viz.transect.horiz.find_spherical_transect_cells_and_weights() or polaris.ocean.viz.transect.horiz.find_planar_transect_cells_and_weights(). Also, compute interpolation weights such that observations at points on the original transect and with vertical coordinate transectZ can be bilinearly interpolated to the nodes of the transect.

Parameters
  • ds_horiz_transect (xarray.Dataset) – A dataset that defines nodes of the transect

  • layer_thickness (xarray.DataArray) – layer thicknesses on the MPAS mesh

  • 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

Returns

ds_transect (xarray.Dataset) – A dataset that contains nodes and cells that make up a 2D transect.

There are nSegments horizontal and nHalfLevels vertical transect cells (quadrilaterals), bounded by nHorizNodes horizontal and nVertNodes vertical nodes (corners).

In addition to the variables and coordinates in the input ds_transect, the output dataset contains:

  • validCells, validNodes: which transect cells and nodes are valid (above the bathymetry and below the sea surface)

  • zTransectNode: the vertical height of each triangle node

  • ssh, zSeaFloor: the sea-surface height and sea-floor height at each node of each transect segment

  • cellIndices: the MPAS-Ocean cell of a given transect segment

  • levelIndices: the MPAS-Ocean vertical level of a given transect level

  • interpCellIndices, interpLevelIndices: the MPAS-Ocean cells and levels from which the value at a given transect cell is interpolated. This can involve up to nHorizWeights * nVertWeights = 12 different cells and levels.

  • interpCellWeights: the weight to multiply each field value by to perform interpolation to a transect cell.

  • dInterfaceSegment, zInterfaceSegment - segments that can be used to plot the interfaces between MPAS-Ocean layers

  • dCellBoundary, zCellBoundary - segments that can be used to plot the vertical boundaries between MPAS-Ocean cells

Interpolation of a DataArray from MPAS cells and levels to transect cells can be performed with polaris.ocean.viz.transect.vert.interp_mpas_to_transect_cells(). Similarly, interpolation to transect nodes can be performed with polaris.ocean.viz.transect.vert.interp_mpas_to_transect_nodes().