Build baseline with constant level during a wet period
Parameters:
trsl (numpy.array or pandas.Series) – Transmitted signal level minus received signal level (TRSL) or
received signal level or t
wet (numpy.array or pandas.Series) – Information if classified index of times series is wet (True)
or dry (False). Note that NaN`s in `wet will lead to NaN`s in
`baseline also after the NaN period since it is then not clear
whether or not there was a change of wet/dry within the NaN period.
n_average_last_dry (int, default = 1) – Number of last baseline values before start of wet event that should
be averaged to get the value of the baseline during the wet event.
Note that this values should not be too large because the baseline
might be at an expected level, e.g. if another wet event is
ending shortly before.
Build baseline with linear interpolation from start till end of wet period
Parameters:
rsl (numpy.array or pandas.Series) –
Received signal level or transmitted signal level minus received
signal level
wet (numpy.array or pandas.Series) – Information if classified index of times series is wet (True)
or dry (False). Note that NaN`s in `wet will lead to NaN`s in
`baseline also after the NaN period since it is then not clear
wheter there was a change of wet/dry within the NaN period.
ignore_nan (bool) – If set to True the last wet/dry state before a NaN will be used for deriving
the baseline. If set to False, the baseline for any wet period which contains
a NaN will be set to NaN for the duration of the wet period. Default is False.
Approximation of parameters a and b for k-R power law
Parameters:
f_GHz (int, float, np.array or xr.DataArray) – Frequency of the microwave link(s) in GHz.
pol (str, np.array or xr.DataArray) – Polarization, that is either ‘horizontal’ for horizontal or ‘vertical’
for vertical. ‘H’, ‘h’ and ‘Horizontal’ as well as ‘V’, ‘v’ and ‘Vertical’
are also allowed. Must have same shape as f_GHz or be a str. If it is a
str, it will be expanded to the shape of f_GHz.
approx_type (str, optional) – Approximation type (the default is ‘ITU_2005’, which implies parameter
approximation using a table recommanded by ITU in 2005. An older version
of 2003 is available via ‘ITU_2003’.)
Returns:
a,b – Parameters of A-R relationship
Return type:
float
Note
The frequency value must be between 1 Ghz and 100 GHz.
The polarization has to be indicated by ‘h’ or ‘H’ for horizontal and
‘v’ or ‘V’ for vertical polarization respectively.
Currently only ‘ITU’ for approx_type is accepted. The approximation makes
use of a table recommanded by ITU [4]. There are two versions available,
P.838-2 (04/2003) and P.838-3 (03/2005).
Calculate rain rate from path-integrated attenuation using the k-R power law
Note that either f_GHz and pol or a and b have to be provided. The former
option calculates the parameters a and b for the k-R power law internally
based on frequency and polarization.
Parameters:
A (float or iterable of float) – Path-integrated attenuation of microwave link signal
L_km (float) – Length of the link in km
f_GHz (float, np.array, or xr.DataArray optional) – Frequency in GHz. If provided together with pol, it will be used to
derive the parameters a and b for the k-R power law.
pol (string, np.array or xr.DataArray optional) – Polarization, that is either ‘horizontal’ for horizontal or ‘vertical’
for vertical. ‘H’, ‘h’ and ‘Horizontal’ as well as ‘V’, ‘v’ and ‘Vertical’
are also allowed. Has to be provided together with f_GHz. It will be
used to derive the parameters a and b for the k-R power law. Must have
same shape as f_GHz or be a str. If it is a str, it will be expanded to
the shape of f_GHz.
a (float, optional) – Parameter of A-R relationship
b (float, optional) – Parameter of A-R relationship
a_b_approximation (string) – Specifies which approximation for the k-R power law shall be used. See the
function a_b for details.
R_min (float) – Minimal rain rate in mm/h. Everything below will be set to zero.
Returns:
Rain rate
Return type:
float or iterable of float
Note
The A-R and k-R relation are defined as
\[A = k L_{km} = aR^{b} L_{km}\]
where A is the path-integrated attenuation in dB and k is the specific
attenuation in dB/km.
Calculate rain rate from attenuation using the A-R Relationship
Parameters:
Ar_max (float or iterable of float) – Attenuation of microwave signal (with min/max measurements of RSL/TSL)
f_GHz (float, optional) – Frequency in GHz
pol (string) – Polarization, default is ‘H’
a (float, optional) – Parameter of A-R relationship
b (float, optional) – Parameter of A-R relationship
L (float) – length of the link
R_min (float) – Minimal rain rate in mm/h. Everything below will be set to zero.
k (int, optional) – number of measurements between two consecutive measurement of rx/tx
Returns:
Rain rate
Return type:
float or iterable of float
Note
Based on: “Empirical Study of the Quantization Bias Effects in
Commercial Microwave Links Min/Max Attenuation
Measurements for Rain Monitoring” by OSTROMETZKY J., ESHEL A.
Calculate wet antenna attenuation according to Leijnse et al. 2008
Calculate the wet antenna attenuation from observed attenuation,
using the method proposed in [2], assuming a rain rate dependent
thin flat water film on the antenna.
The equations proposed in [2] calculate the WAA from the rain rate R.
With CML data the rain rates is not directly available. We need to use
the observed attenuation to derive the WAA. This is done here by building
a look-up-table for the relation between A_obs and WAA, where A_obs is
calculated as A_obs = A_rain + WAA. A_rain is derived from the A-R relation
for the given CML frequency and length.
Parameters:
A_obs (array-like or scalar) – Observed attenuation
f_Hz (array-like or scalar (but only either R or f_Hz can be array)) – Frequency of CML in Hz
pol (string) – Polarization of CML. Has to be either ‘H’ or ‘V’.
L_km (float) – Lenght of CML in kilometer
gamma (float) – Parameter that determines the magnitutde of the water film thickness
delta (float) – Parameter that determines the non-linearity of the relation
between water film thickness and rain rates
n_antenna (float) – Refractive index of antenna material
Calculate wet antenna attenuation according to Pastorek et al. 2021 [3]
(model denoted “KR-alt” in their study, i.e. a variation of the WAA model
suggested by Kharadly and Ross 2001 [4])
Calculate the wet antenna from rain rate explicitly assuming an upper limit
A_max.
Calculate wet antenna attenuation according to Pastorek et al. 2021 [3]
(model denoted “KR-alt” in their study, i.e. a variation of the WAA model
suggested by Kharadly and Ross 2001 [4])
Calculate the wet antenna from rain rate explicitly assuming an upper limit
A_max.
The equation proposed in [3] calculates the WAA from the rain rate R.
With CML data the rain rates is not directly available. We need to use
the observed attenuation to derive the WAA. This is done here by building
a look-up-table for the relation between A_obs and WAA, where A_obs is
calculated as A_obs = A_rain + WAA. A_rain is derived from the A-R relation
for the given CML frequency and length.
Parameters:
A_max (upper bound of WAA (“C” in [3]))
R (array-like or scalar) – Rain rate in mm/h
f_Hz (array-like or scalar (but only either R or f_Hz can be array)) – Frequency of CML in Hz
pol (string) – Polarisation of CML. Must be either ‘H’ or ‘V’.
A decorator to apply CML processing function along the time dimension of DataArrays
This will work if the decorated function takes 1D numpy arrays, which hold the
CML time series data, as arguments. Additional argument are also handled.