MCPcopy Create free account
hub / github.com/NCAR/wrf-python / eth

Function eth

src/wrf/computation.py:1667–1722  ·  view source on GitHub ↗

Return the equivalent potential temperature. This is the raw computational algorithm and does not extract any variables from WRF output files. Use :meth:`wrf.getvar` to both extract and compute diagnostic variables. Args: qv (:class:`xarray.DataArray` or :class:`numpy.nda

(qv, tkel, pres, meta=True, units="K")

Source from the content-addressed store, hash-verified

1665 description="equivalent potential temperature")
1666@convert_units("temp", "k")
1667def eth(qv, tkel, pres, meta=True, units="K"):
1668 """Return the equivalent potential temperature.
1669
1670 This is the raw computational algorithm and does not extract any variables
1671 from WRF output files. Use :meth:`wrf.getvar` to both extract and compute
1672 diagnostic variables.
1673
1674 Args:
1675
1676 qv (:class:`xarray.DataArray` or :class:`numpy.ndarray`): Water vapor
1677 mixing ratio in [kg/kg] that is at least three dimensions, with
1678 the rightmost dimensions of bottom_top x south_north x west_east.
1679
1680 tkel (:class:`xarray.DataArray` or :class:`numpy.ndarray`): Temperature
1681 in [K] with same dimensionality as *qv*.
1682
1683 Note:
1684
1685 This variable must be
1686 supplied as a :class:`xarray.DataArray` in order to copy the
1687 dimension names to the output. Otherwise, default names will
1688 be used.
1689
1690 pres (:class:`xarray.DataArray` or :class:`numpy.ndarray`): Full
1691 pressure (perturbation + base state pressure) in [Pa] with the
1692 same dimensionality as *qv*.
1693
1694 meta (:obj:`bool`): Set to False to disable metadata and return
1695 :class:`numpy.ndarray` instead of
1696 :class:`xarray.DataArray`. Default is True.
1697
1698 units (:obj:`str`): The desired units. Refer to the :meth:`getvar`
1699 product table for a list of available units for 'eth'. Default
1700 is 'K'.
1701
1702 Warning:
1703
1704 The input arrays must not contain any missing/fill values or
1705 :data:`numpy.nan` values.
1706
1707 Returns:
1708
1709 :class:`xarray.DataArray` or :class:`numpy.ndarray`: The
1710 equivalent potential temperature. If xarray is enabled and
1711 the *meta* parameter is True, then the result will be an
1712 :class:`xarray.DataArray` object. Otherwise, the result will
1713 be a :class:`numpy.ndarray` object with no metadata.
1714
1715 See Also:
1716
1717 :meth:`wrf.getvar`, :meth:`wrf.temp`, :meth:`wrf.wetbulb`,
1718 :meth:`tvirtual`
1719
1720 """
1721
1722 return _eth(qv, tkel, pres)
1723
1724

Callers

nothing calls this directly

Calls 1

_ethFunction · 0.85

Tested by

no test coverage detected