module TopoPyScale.meteo_util
Global Variables
- var_era_plevel
- var_era_surf
- g
- R
- eps0
- S0
function steep_snow_reduce_all
function partition_snow
partition_snow(
precip,
temp,
rh=None,
sp=None,
method='continuous',
tair_low_thresh=272.15,
tair_high_thresh=274.15
)
Function to partition precipitation in between rain vs snow based on temperature threshold and mixing around freezing. The methods to partition snow/rain precipitation are: - continuous: method implemented into Cryogrid. - jennings2018 methods are from the publication Jennings et al (2018). DOI: https://doi.org/10.1038/s41467-018-03629-7
Args:
precip(array): 1D array, precipitation in mm/hrtemp(arrray): 1D array, air temperature in Krh(array): 1D array, relative humidity in %sp(array): 1D array, surface pressure in Pamethod(str): 'continuous', 'Jennings2018_bivariate', 'Jennings2018_trivariate'.tair_low_thresh(float): lower temperature threshold under which all precip is snow. degree Ktair_high_thresh(float): higher temperature threshold under which all precip is rain. degree K
Returns:
array: 1D array rainarray: 1D array snow
function q_2_rh
Function to convert specific humidity (q) to relative humidity (RH) following Bolton (1980)
Args:
temp(array): temperature in degree Kpressure(array): aire pressure in Paqair(array): specific humidity in kg/kg
Returns:
array: relative humidity in the range of [0-1]
function mixing_ratio
Function to compute mixing ratio
Args:
ds: dataset (following ERA5 variable convention) q-specific humidity in kg/kgvar: dictionnary of variable name (for ERA surf / ERA plevel) Returns: dataset with new variable 'w'
function t_rh_2_dewT
Function to compute dea temperature from air temperature and relative humidity
Args:
ds: dataset with temperature ('t') and relative humidity ('r') variablesvar: dictionnary of variable name (for ERA surf / ERA plevel)
Returns:
dataset: with added variable
function dewT_2_q_magnus
A version of the Magnus formula with the AERK parameters. AERK from Alduchov and Eskridge (1996) Note, e=Magnus(tdc) and es=Magnus(tc)
Args:
ds: dataset withvar: dictionnary of variable name (for ERA surf / ERA plevel)
Returns:
array: specific humidity in kg/kg
function vapor_pressure
Function to compute Vapor pressure from mixing ratio based on 2nd order Taylor series expansion
Args:
ds(dataset): dataset with pressure and mix_ratio variablesvar(dict): variable name correspondance
Returns:
dataset: input dataset with newvpcolumns
This file was automatically generated via lazydocs.