polaris.ocean.eos.convert_tracer_pair
- polaris.ocean.eos.convert_tracer_pair(temperature: DataArray | ndarray | float, salinity: DataArray | ndarray | float, target: str, pressure: DataArray | float, lon: DataArray | ndarray | float, lat: DataArray | ndarray | float) tuple[DataArray, DataArray][source]
Convert a single temperature and salinity pair to the
targetconvention.This is the array-level counterpart of
convert_tracers(), for callers that have tracers in hand rather than in a dataset. See that function for the accuracy ofpressure.- Parameters:
temperature (float, numpy.ndarray or xarray.DataArray) – Conservative or potential temperature, according to the convention being converted from.
salinity (float, numpy.ndarray or xarray.DataArray) – Absolute or practical salinity, at the same points as
temperature.target ({'teos-10', 'mpas-ocean'}) – The tracer convention to convert to.
pressure (float or xarray.DataArray) – Sea (gauge) pressure in Pa, broadcastable against the tracers.
lon (float, numpy.ndarray or xarray.DataArray) – Longitude(s) in degrees, either a nominal scalar value (e.g. on a planar mesh) or an array with dimension
nCells.lat (float, numpy.ndarray or xarray.DataArray) – Latitude(s) in degrees, a scalar or an array with dimension
nCells, as forlon.
- Returns:
temperature (xarray.DataArray) – The temperature in the
targetconvention.salinity (xarray.DataArray) – The salinity in the
targetconvention.