Using gsw alone.
Suppose a CTD instrument lowered in the sea at 188E and 4N measures Practical Salinity to be 35 and in-situ temperature 10C (ITS-90) at pressure 100dbar. Then the following calculates the Absolute Salinity:which sets
SAto 35.16555 g/kg. This value may be used along with in-situ temperature and pressure, to calculate the Conservative Temperature: which sets
CTto 9.978249 ℃. Now, density and surface-referenced potential density can be calculated with yielding 1027.407 kg/m3 and 1026.956 kg/m3, respectively.
This is just a small sampling of what gsw can do; see the Documentation tab for a list of functions provided in this package, and the package documentation and vignette for more information.
Using gsw within oce.
Gsw is integrated deeply into the oce package. It can be selected as an option to most functions. For example, a TS diagram in gsw convention can be created as follows.