1. Algorithms for MLH Retrieval

1.1. Idealized point function method

@author: Burgos Andrea, Translated to Python by JLGF.

This function obtains the residual layer height from an idealized profile. The method is thoroughly described in [Steyn (1999), Wang et. al. (2016)] but basically obtains boundary layer parameters by fitting an idealized backscatter profile to the observed profile, where the Residual Layer Height (RLH) is determined by the profile that reduces the error between the idealized and the observed profiles through a minimum.

The idealized profile \(B(r)\) is given by:

\[B(r)=\frac{B_m+B_\mu}{2} - \frac{B_m-B_\mu}{2} erf \bigg(\frac{r-r_m}{s}\bigg) .\]
  • \(B_m\) Mean mixed layer backscatter.
  • \(B_\mu\) mean backscatter in the air inmediately above the mixed layer depth.
  • \(r_m\) Mixed layer depth.
  • \(erf\) Error function.
Args:
allprf (numpy array): Backscattering matrix.
Kwargs:
state (bool): Current state to be in.
Returns:
float: Residual Layer Height (m)

A way you might use me is

>>> residual_h=ipf(backscattering,z,t)

This returns the residual layer height to be used by the algorithm.

It is important to note that this function makes use of the scipy function erf, so scipy must be installed:

from scipy.special import erf
ipf.ipf(allprf, z, t)[source]

Format the exception with a traceback.

allprf: backscattering matrix, numpy array nxm dims param t: time vector, typically decimal time hours.minutes param z: height vector, typically numpy array ranging from 10 to 5000 m. Return float: Residual Layer Height

1.2. Wavelet Covariant Transform Algorithm

1.2.1. Description

This toolbox contains functions used in the retrieval of the mixed-layer height following a wavelet covariant transform algorithm, from [Bro03]. Roughly, this method compares the local match or similarity between the Haar wavelet function and the backscattering profile. This could be interpreted as pattern search for a sudden jump. In fact, this same procedure is used to analyze electric signals and find electric jumps.

The code is written to operate between functions that follow the recursive algorithm by :cite:Grabon2010.

wavelets.haarcovtransfm(allprf, z1, i, a, f, t, tope, botom)[source]

This function does something

Parameters:
  • allprf – backscattering matrix, numpy array nxm dims
  • z1 – height vector, typically np.array ranging from 100 to 5000 m.
  • i – index for current time value. (integer)
  • a – Dilation type, string for either (Automated or Standard) see below for further explanation.
  • f – Initial resolution between steps, integer.
  • tope – Maximum height where mixed-layer or boundary layer can be obtained (float).
  • botom – Minimum height [m] where mixed layer or BL can be obtained, float.
Return type:

float: Residual Layer Height

Formula adopted from [Bro03], Grabon2010]_.

\[W_f(a,b)=\frac{1}{a}\int_{z_0}^{z_{max}}B(z)H\bigg(\frac{(z-b)}{a}\bigg)).\]
  • \(W_f\) Wavelet transform

  • \(a\) Dilation value, in [m]

  • \(b\) Wavelet translation, in [m]

  • \(z_0\) Minimum integration level [m]

  • \(z_{max}\) Maximum integration level [m]

  • \(B(z)\) Backscaterring matrix

    Returns MLH, BLmin, BLmax

wavelets.haarval(prf, a, b0)[source]

Obtain haar value, compute every Wf(a,b)

Parameters

prf: np.nadarray
backscattering profile at time ti
a : float
Wavelet dilation.
b0 : float
Translation point in z.
Return type:float: Wavelet transform coefficient at dilation a and translation b.

Haar Wavelet

\[\begin{split}h\bigg(\frac{z-b}{a}\bigg) = \begin{cases} + 1 & b-\frac{a}{2}\leq z\leq 0 \\ -1 & b \leq z \leq b+\frac{a}{2} \\ 0 & otherwise \end{cases}\end{split}\]

findtops, haarcovtransfm

wavelets.findtops(prf, wf, newmlh, a)[source]

Boundary Layer Height and Entrainment layer thickness.

Find boundary layer top and bottom, similar to [Bro03][GDKE10]. This method follows a recursive method of analizying different dilations and translations, as a wavelet transform does. In this sense, we vary both a and b discretly. First a ranges from 120 [m] and decreases with a step of 20 [m] until the lowest dilation of 20 [m]. Similarly, b varies from the bottom value to the top value in increments of 10 [m].

Parameters

prf: np.nadarray
backscattering profile at time ti
wf : np.array wf(a_0,b)
Wavelet covariant transform coefficients.
newmlh : float
New mixed-layer value
Return type:array of floats: Bottom of entrainment layer, mixed-layer height and top of entrainment layer

Haar Wavelet recursive algorithm

The height of the bottom of the entrainment layer E_L, and the height top of the entrainment layer E_U
are given by:
\[E_L=\frac{2}{5}W_f(a_0,b)\]
\[E_U=\frac{3}{5}W_f(a_0,b)\]

findtops, haarcovtransfm

wavelets.firstmlh(prf, a, bottom)[source]

First mixed-layer height value

Retrieve first mixed layer-height value for initial dilation a..

Parameters

prf: np.nadarray
backscattering profile at time ti
a : np.array wf(a_0,b)
Wavelet covariant transform coefficients.
bottom : float
Lowest allowed value for mixed layer height retrieval.
Return type:float: First mixed layer height value

The mixed-layer height under ref{brooks2003,Grabon2010} is given by the maximum of the wavelet covariance transfrom for a dilation a in a translation b, i.e.:

\[MLH=max(W_f(a,b))\]

This script provides the first or only estimate of the MLH depending on how the script is run. If the recursive method is used then this MLH will change as the dilation changes, however, if the recursive method is not used then this MLH is exactly the maximum of W_f(120,b) where a=120 is recommended by ref{brooks2003} as the initial or only dilation value.

See Also

findtops, haarcovtransfm, haarval

1.3. Linking Pages

[Bro03](1, 2, 3) Ian M. Brooks. Finding boundary layer top: application of a wavelet covariance transform to lidar backscatter profiles. Journal of Atmospheric and Oceanic Technology, 20(8):1092–1105, 2003. URL: https://doi.org/10.1175/1520-0426(2003)020<1092:FBLTAO>2.0.CO;2, doi:10.1175/1520-0426(2003)020<1092:FBLTAO>2.0.CO;2.
[GarciaFSB+18]J. L. García-Franco, W. Stremme, A. Bezanilla, A. Ruiz-Angulo, and M. Grutter. Variability of the mixed-layer height over mexico city. Boundary-Layer Meteorology, Feb 2018. URL: https://doi.org/10.1007/s10546-018-0334-x.
[GDKE10]Jeffrey S Grabon, Kenneth J Davis, Christoph Kiemle, and Gerhard Ehret. Airborne lidar observations of the transition zone between the convective boundary layer and free atmosphere during the international h 2 o project (ihop) in 2002. Boundary-layer meteorology, 134(1):61, 2010.