polaris.ocean.vertical.elevation.parse_vertical_reduction

polaris.ocean.vertical.elevation.parse_vertical_reduction(spec)[source]

Parse one entry of the elevations or the elevation_ranges config option

Both options describe a way of reducing the nVertLevels dimension, so both are parsed here and the result says which way it is.

Parameters:

spec (str) – One of 'top', 'bottom', 'k<index>' with a zero-based index, an elevation in m (positive up, so negative within the ocean), or an elevation range written <top_elevation>:<bottom_elevation>

Returns:

reduction (VerticalReduction) – The parsed reduction

Raises:

ValueError – If spec is none of those