Skip to content

module TopoPyScale.meteo_util

Global Variables

  • var_era_plevel
  • var_era_surf
  • g
  • R
  • eps0
  • S0

function steep_snow_reduce_all

steep_snow_reduce_all(snow, slope)

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/hr
  • temp (arrray): 1D array, air temperature in K
  • rh (array): 1D array, relative humidity in %
  • sp (array): 1D array, surface pressure in Pa
  • method (str): 'continuous', 'Jennings2018_bivariate', 'Jennings2018_trivariate'.
  • tair_low_thresh (float): lower temperature threshold under which all precip is snow. degree K
  • tair_high_thresh (float): higher temperature threshold under which all precip is rain. degree K

Returns:

  • array: 1D array rain
  • array: 1D array snow

function q_2_rh

q_2_rh(temp, pressure, qair)

Function to convert specific humidity (q) to relative humidity (RH) following Bolton (1980)

Args:

  • temp (array): temperature in degree K
  • pressure (array): aire pressure in Pa
  • qair (array): specific humidity in kg/kg

Returns:

  • array: relative humidity in the range of [0-1]

function mixing_ratio

mixing_ratio(ds, var)

Function to compute mixing ratio

Args:

  • ds: dataset (following ERA5 variable convention) q-specific humidity in kg/kg
  • var: dictionnary of variable name (for ERA surf / ERA plevel) Returns: dataset with new variable 'w'

function t_rh_2_dewT

t_rh_2_dewT(ds, var)

Function to compute dea temperature from air temperature and relative humidity

Args:

  • ds: dataset with temperature ('t') and relative humidity ('r') variables
  • var: dictionnary of variable name (for ERA surf / ERA plevel)

Returns:

  • dataset: with added variable

function dewT_2_q_magnus

dewT_2_q_magnus(ds, var)

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 with
  • var: dictionnary of variable name (for ERA surf / ERA plevel)

Returns:

  • array: specific humidity in kg/kg

function vapor_pressure

vapor_pressure(ds, var)

Function to compute Vapor pressure from mixing ratio based on 2nd order Taylor series expansion

Args:

  • ds (dataset): dataset with pressure and mix_ratio variables
  • var (dict): variable name correspondance

Returns:

  • dataset: input dataset with new vp columns

This file was automatically generated via lazydocs.