act.utils.convert_to_potential_temp

act.utils.convert_to_potential_temp(ds=None, temp_var_name=None, press_var_name=None, temperature=None, pressure=None, temp_var_units=None, press_var_units=None)[source]

Converts temperature to potential temperature.

Parameters:
  • ds (xarray.DataSet) – ACT Xarray dataset

  • temp_var_name (str) – Temperature variable name in the ACT Xarray dataset containing temperature data to convert.

  • press_var_name (str) – Pressure variable name in the ACT Xarray dataset containing the pressure data to use in conversion. If not set or set to None will use values from pressure keyword.

  • pressure (int, float, numpy array) – Optional pressure values to use instead of using values from xarray dataset. If set must also set press_var_units keyword.

  • temp_var_units (string) – Pint recognized units string for temperature data. If set to None will use the units attribute under temperature variable in ds.

  • press_var_units (string) – Pint recognized units string for pressure data. If set to None will use the units attribute under pressure variable in the dataset. If using the pressure keyword this must be set.

Returns:

potential_temperature (None, int, float, numpy array) – The converted temperature to potential temperature or None if something goes wrong.

References

May, R. M., Arms, S. C., Marsh, P., Bruning, E., Leeman, J. R., Goebbert, K., Thielen, J. E., and Bruick, Z., 2021: MetPy: A Python Package for Meteorological Data. Unidata, https://github.com/Unidata/MetPy, doi:10.5065/D6WW7G29.