polaris.ocean.vertical.diagnostics.depth_from_thickness

polaris.ocean.vertical.diagnostics.depth_from_thickness(ds, ds_vert=None)[source]

Get the elevation of the midpoint of each layer

A thin face on get_z_mid_and_interface() for callers that want only the midpoints. What the model wrote is preferred; the geometry is reconstructed from layerThickness when it is absent.

Parameters:
  • ds (xarray.Dataset) – An ocean dataset carrying the geometry or layerThickness, and optionally ssh and bottomDepth

  • ds_vert (xarray.Dataset, optional) – The vertical coordinate dataset containing bottomDepth and optionally minLevelCell and maxLevelCell, used when reconstructing the geometry

Returns:

z_mid (xarray.DataArray) – The location in meters from the sea surface of the midpoint of each layer, positive upward