xoa.thermdyn.convert_temp#
- xoa.thermdyn.convert_temp(temp, to='ctemp', temp_kind=None, sal=None, sal_kind=None, z=None, lat=None, lon=None)[source]#
Convert a temperature from a kind to another one
- Parameters:
temp (xarray.DataArray) – Temperature in degrees Celsius or Kelvin
to (str) – Target kind, among
"temp","ptemp"and"ctemp", or their aliases.temp_kind ({None, 'temp', 'insitu', 'ctemp', 'conservative', 'ptemp', 'potential'}) –
Kind of temperature
None: Inferred from the array, else potential'temp'|'insitu': In situ'ctemp'|'conservative': Conservative temperature'ptemp'|'potential': Potential temperature
sal (xarray.DataArray, None) – Salinity, which is needed when the kinds differ.
sal_kind (str, None) – Kind of sal, as in
convert_sal().z (None, xarray.DataArray) – Vertical coordinate, which defaults to the z or depth of temp. See
xoa.coords.as_z()for the sign convention.lat (None, float, xarray.DataArray) – Latitudes and longitudes, that default to the coordinates of temp. The latitude is needed to compute the pressure from the depth.
lon (None, float, xarray.DataArray) – Latitudes and longitudes, that default to the coordinates of temp. The latitude is needed to compute the pressure from the depth.
- Returns:
xarray.DataArray – In degrees Celsius.
See also