act.utils.height_adjusted_temperature

act.utils.height_adjusted_temperature(ds=None, temp_var_name=None, height_difference=0, height_units='m', press_var_name=None, temperature=None, temp_var_units=None, pressure=101.325, press_var_units='kPa')[source]

Converts temperature for change in height.

Parameters:
  • ds (xarray.DataSet, None) – Optional Xarray dataset for retrieving pressure and temperature values. Not needed if using temperature keyword.

  • temp_var_name (str, None) – Optional temperature variable name in the Xarray dataset containing the temperature data to use in conversion. If not set or set to None will use values from temperature keyword.

  • height_difference (int, float) – Required difference in height to adjust pressure values. Positive values to increase height negative values to decrease height.

  • height_units (str) – Units of height value.

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

  • temperature (int, float, numpy array, None) – Optional temperature values to use instead of values in the dataset.

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

  • pressure (int, float, numpy array, None) – Optional pressure values to use instead of values in the dataset. Default value of sea level pressure is set for ease of use.

  • press_var_units (str, None) – 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. Default value of sea level pressure is set for ease of use.

Returns:

adjusted_temperature (None, int, float, numpy array) – The height adjusted 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.