gsw_py_mat Functions

This section documents the Python and Matlab functions that are available in the gsw_py_mat.

Python Function

Python interface to Matlab GSW functions.

gsw_py_mat.py_cmd.make_matlab_cmd(scriptname, filename, args)[source]

Return a command to run the Matlab script scriptname.

Parameters:
  • scriptname (str) – Name of the Matlab script to make the command for.
  • filename (str) – Name of file in which Matlab script will store its results.
  • args (list) – Arguments to pass to the Matlab script.
Returns:

Command suitable to be passed to subprocess.run().

Return type:

list

Matlab Functions

gsw_py_mat.startup()

Matlab startup function that provides access to the Matlab GSW3 library.

Note

Only works on machines that have access /ocean/.

gsw_py_mat.mw_gsw_CT_from_t(filename, SA, t, p)

Calculate conservative temperature from absolute salinity, in situ temperature, and pressure.

Parameters:
  • filename – Name of file in which Matlab script will store its results.
  • SA – Absolute salinity.
  • t – Temperature.
  • p – Pressure.
gsw_py_mat.mw_gsw_SA_from_SP(filename, SP, p, lon, lat)

Calculate absolute salinity from practical salinity and pressure with corrections based on longitude and latitude.

Parameters:
  • filename – Name of file in which Matlab script will store its results.
  • SP – Practical salinity.
  • p – Pressure.
  • lon – Longitude of the location at which the salinity is to be calculated.
  • lat – Latitude of the location at which the salinity is to be calculated.