Wet/Dry classification

This module groups the methods related to wet/dry classification of the CML signal.
cml, gauges = open_cml_sample(), open_gauge_sample()

Adaptation of the Schleiss and Berne (2010) algorithm to NMS min/max sampling

Caution

This section contains an adaptation and a summary of the original paper. For a detailed explanation please check Schleiss and Berne (2010)

This method was originally designed to work on time-varying attenuation baseline. The main advantage is that it only uses path-integrated attenuation measurements from single-polarization and single frequency commercial microwave links and thus does not need any calibration from external sources such as rain gauges or radars, which makes it very suitable for territories with observation scarcity.

The method relies on the assumption that the variability of the signal is small during dry periods and large during rainy periods.

The method consists of two steps. First, the local variability \(S_{W_t}\) is computed for a given moving time window. Second, a variability threshold \(\sigma_0\) value is computed. Then:

\[\text{Decision rule: } \begin{cases} \text{rain if } S_{W_t} > \sigma_0 \\ \text{dry if } S_{W_t} \leq \sigma_0 \end{cases}\]

The original method was based on a 30-second sampling rate (instantaneous), from which \(S_{W_t}\) was calculated for a temporal window of 15 to 35 minutes. This interval was found optimal for capturing rain dynamics. However, when working with NMS min/max sampling, the temporal windows are usually on the order of several minutes. Thus its not possible to calculate variability using the proposed formula. To tackle this issue, we use a simplified version of variability calculated as:

\[ S_{W_t} = TSL_{max} - RSL_{min} \]

We’ve chosen this variable because we have found that for a one variable model this is the one that best predicts the wet/dry events.

Regarding the second step, two methods are proposed depending on the amount of available data. If few data are available, \(\sigma_0\) can be estimated based on a collection of non-consecutive dry periods. However, this method requires local measurements to determine which are dry periods, so it is left for future work.

If a large amount of data is available (several months), we can assume that rainy periods represent only a fraction r of all the available periods. This fraction will depend on the region, so we recommend studying it for your specific use case. However, a default value of 0.05 to 0.15 (i.e., it rains 5% to 15% of the time) seems coherent with the original paper and our own experience. We will set it to 0.1. As a rule of thumb, a larger r will tend to produce more false positives while a smaller r will produce more false negatives. Thus, the threshold is computed as: \[ \sigma_0 = q_{1−r}\{S_{W_t}\} \] where \(q_{1−r}\) denotes the \((1 − r)\) quantile.


source

schleiss_n_berne_2010_nms_adapted


def schleiss_n_berne_2010_nms_adapted(
    cml:Dataset, # Input CML dataset with tsl_max and rsl_min variables
    r:float=0.1, # Fraction of time it is assumed to be raining
)->Dataset:

Wet Dry classification algorithm adapted to work with NMS sampling adapted from Schleiss and Berne (2010).

wet_pred = schleiss_n_berne_2010_nms_adapted(cml)
wet_pred
<xarray.DataArray 'wet' (cml_id: 126, sublink_id: 6, time: 2964)> Size: 2MB
False False False False False False ... False False False False False False
Coordinates: (10)
Attributes:
    units:      dBm
    long_name:  wet_dry_classification
    method:     schleiss_n_berne_2010_adapted_to_nms_min_max_sampling

References

  • Schleiss, M., and A. Berne, 2010: Identification of dry and rainy periods using telecommunication microwave links. IEEE Geosci. Remote Sens. Lett., 7, 611–615, https://doi.org/10.1109/LGRS.2010.2043052.

Sample data generation

As we will need sample data from different processing steps to help with development and illustration, we will save the generated wet classification as a sample.

schleiss_n_berne_2010_nms_adapted(cml).to_netcdf(get_cml_sample_fp("wetdry"), encoding={"wet": {"zlib": True, "complevel": 5}})