Additional functions

find_nearest(array, value) Find the index of the item in the array nearest to the value
TropD_Calculate_MaxLat(F, lat[, n]) Find latitude of absolute maximum value for a given interval
TropD_Calculate_Mon2Season(Fm[, season, m]) Calculate seasonal means from monthly time series
TropD_Calculate_StreamFunction(V, lat, lev) Calculate streamfunction by integrating meridional wind from top of the atmosphere to surface
TropD_Calculate_TropopauseHeight(T, P[, Z]) Calculate the Tropopause Height in isobaric coordinates
TropD_Calculate_ZeroCrossing(F, lat[, ...]) Find the first (with increasing index) zero crossing of the function F

Description of additional functions

functions.TropD_Calculate_MaxLat(F, lat, n=6)[source]

Find latitude of absolute maximum value for a given interval

Parameters:
  • F – 1D array
  • lat – equally spaced latitude array
  • n (int) – rank of moment used to calculate the position of max value. n = 1,2,4,6,8,...
Returns:

location of max value of F along lat

Return type:

float

functions.TropD_Calculate_Mon2Season(Fm, season=array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]), m=0)[source]

Calculate seasonal means from monthly time series

Parameters:
  • Fm – array of dimensions (time, latitude, level) or (time, level) or (time, latitude)
  • season – array of months e.g., [-1,0,1] for DJF
  • m (int) – index of first of January
Returns:

the annual time series of the seasonal means

Return type:

ndarray

functions.TropD_Calculate_StreamFunction(V, lat, lev)[source]

Calculate streamfunction by integrating meridional wind from top of the atmosphere to surface

Parameters:
  • V – array of zonal-mean meridional wind with dimensions (lat, lev)
  • lat – equally spaced latitude array
  • lev – vertical level array in hPa
Returns:

the streamfunction psi(lat,lev)

Return type:

ndarray

functions.TropD_Calculate_TropopauseHeight(T, P, Z=None)[source]

Calculate the Tropopause Height in isobaric coordinates

Based on the method described in Birner (2010), according to the WMO definition: first level at which the lapse rate <= 2K/km and for which the lapse rate <= 2K/km in all levels at least 2km above the found level

Parameters:
  • T – Temperature array of dimensions (latitude, levels) on (longitude, latitude, levels)
  • P – pressure levels in hPa
  • Z (optional) – geopotential height [m] or any field with the same dimensions as T
Returns:

If Z = None, returns Pt(lat) or Pt(lon,lat), the tropopause level in hPa

If Z is given, returns Pt and Ht with shape (lat) or (lon,lat). The field Z evaluated at the tropopause. For Z=geopotential height, Ht is the tropopause altitude in m

Return type:

ndarray or tuple

functions.TropD_Calculate_ZeroCrossing(F, lat, lat_uncertainty=0.0)[source]

Find the first (with increasing index) zero crossing of the function F

Parameters:
  • F – array
  • lat – latitude array (same length as F)
  • lat_uncertainty (float, optional) – The minimal distance allowed between adjacent zero crossings of indetical sign change for example, for lat_uncertainty = 10, if the most equatorward zero crossing is from positive to negative, the function will return a NaN value if an additional zero crossings from positive to negative is found within 10 degrees of that zero crossing.
Returns:

latitude of zero crossing by linear interpolation

Return type:

float

functions.find_nearest(array, value)[source]

Find the index of the item in the array nearest to the value

Parameters:
  • array – array
  • value – value be found
Returns:

index of value in array

Return type:

int