Utility Functions#
Note
These are functions that are primarily used internally by the COARE algorithm. However, they are exposed to the user as a part of the public API for the sake of transparency and convenience. Note that documentation for these functions will not be as complete as the documentation for the COARE algorithm itself.
Utility functions for pyCOARE.
Includes functions for calculating normal gravity, relative humidity, saturation vapor pressure, saturation specific humidity at the sea surface, specific humidity from relative humidity, and stability functions for the COARE algorithm.
- pycoare.util.grv(lat)#
Compute normal gravity at latitude lat (degrees) using the WGS84 ellipsoid.
- Parameters:
lat (ArrayLike) – latitude (degrees)
- Returns:
normal gravity (m/s^2)
- Return type:
NDArray[np.float64]
- pycoare.util.psit_26(z_L)#
Compute the temperature structure function given z/L.
- Parameters:
z_L (ArrayLike) – stability parameter
- Returns:
temperature structure function
- Return type:
NDArray[np.float64]
- pycoare.util.psiu_26(z_L)#
Compute the velocity structure function given z/L.
- Parameters:
z_L (ArrayLike) – stability parameter
- Returns:
velocity structure function
- Return type:
NDArray[np.float64]
- pycoare.util.psiu_40(z_L)#
Compute velocity structure function given z/L.
- Parameters:
z_L (ArrayLike) – stability parameter
- Returns:
velocity structure function
- Return type:
NDArray[np.float64]
- pycoare.util.qair(t, p, rh)#
Compute specific humidity given temperature, pressure, and relative humidity.
- Parameters:
t (ArrayLike) – temperature (degC)
p (ArrayLike) – pressure (mb)
rh (ArrayLike) – relative humidity (%)
- Returns:
specific humidity (g/kg), partial pressure (mb)
- Return type:
tuple[NDArray[np.float64], NDArray[np.float64]]
- pycoare.util.qsat(t, p)#
Compute saturation vapor pressure from temperature and pressure.
- Parameters:
t (ArrayLike) – temperature (degC)
p (ArrayLike) – pressure (mb)
- Returns:
saturation vapor pressure (g/kg)
- Return type:
NDArray[np.float64]
- pycoare.util.qsea(t, p, s=35)#
Compute saturation specific humidity at sea surface from temperature and pressure.
- Parameters:
t (ArrayLike) – temperature (degC)
p (ArrayLike) – pressure (mb)
- Returns:
saturation specific humidity (g/kg)
- Return type:
NDArray[np.float64]
- pycoare.util.rhcalc(t, p, q)#
Compute relative humidity from temperature, pressure, and specific humidity.
- Parameters:
t (ArrayLike) – temperature (degC)
p (ArrayLike) – pressure (mb)
q (ArrayLike) – specific humidity (g/kg)
- Returns:
relative humidity (%)
- Return type:
NDArray[np.float64]