Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

poligrain quick tour

This is a very brief overview of features available in the poligrain package. A more comprehensive overview of can be found in the poligrain documentation.

Explore example datasets

We provide the option to download subsets of existing open datasets with opportunistic sensor data. Currently, the following open datasets are supported:

Below we briefly show how to load a subset of the OpenMRG dataset.

The CML data is provided in a xarray.Dataset following the OpenSense naming conventions defined by (Fencl et al., 2023).

Note that this example dataset has already been processed and the rain rates R per CML are stored. Normally are raw CML dataset would only contain RSL and TSL data.

Loading...

Plot point, line and grid data on a map

One key feature of poligrain is the ability to plot point, line and grid data on a map. Plotting points and grids is straightforward with matplotlib. A fast and flexible way to plot line data was missing before.

Below we show an example of how to plot the rainfall accumulatoin of CMLs, rain gauges and radar on a map.

<Figure size 640x480 with 2 Axes>

Project coordinates

We project the coordinates to UTM zone 32N (EPSG:32832), suitable for this dataset from Gothenburg in Sweden, to have correct spatial measurements and distances.

Note that the source projection in project_point_coordinates defaults to WGS84 (EPSG:4326). Our lon-lat coordinates are WGS84, so we do not have to set the source projection explicitly.

Calculate distances between points and lines

point-to-point distances

<Figure size 640x480 with 2 Axes>

point-to-line distances

<Figure size 640x480 with 2 Axes>
<Figure size 640x480 with 2 Axes>

Get radar path-averaged rainfall rates along CMLs

When comparing CML data with radar data we need to intersect the CML paths with the radar grid. poligrain has functions to perform this line-grid intersection efficiently using its GridAtLines class. An equivalent for point data exists with the GridAtPoints class so that point and line data can be used in the same way.

We use the radar rainfall rates and get the path-averages along the CMLs using the GridAtLines class which returns a xarray.DataArray with the original CML IDs and coordinates and the radar data time stamps.

Loading...

Plot the 1h mean rainfall rates of the radar and the CML path-averages for selected time steps.

<Figure size 1200x400 with 6 Axes>

Plot the path-averaged radar rain rate time series and the total path loss tl (transmitted minus received signal level) for selected CMLs.

<Figure size 1200x400 with 2 Axes>
<Figure size 1200x400 with 2 Axes>
<Figure size 1200x400 with 2 Axes>
References
  1. Andersson, J. C. M., Olsson, J., van de Beek, R. (C. Z. ), & Hansryd, J. (2022). OpenMRG: Open data from Microwave links, Radar, and Gauges for rainfall quantification in Gothenburg, Sweden. Earth System Science Data, 14(12), 5411–5426. 10.5194/essd-14-5411-2022
  2. Covi, E., Roversi, G., & Nebuloni, R. (2026). OpenRainER: an open-source dataset for studying the opportunistic sensing of rainfall in Emilia-Romagna, Italy. 10.5194/essd-2026-160
  3. Jacoby, D., Yu, S., Hu, Q., Hine, Z., Johnson, R., Ostrometzky, J., Kadota, I., Zussman, G., & Messer, H. (2025). OpenMesh: Wireless Signal Dataset for Opportunistic Urban Weather Sensing in New York City. 10.5194/essd-2025-238
  4. Fencl, M., Nebuloni, R., C. M. Andersson, J., Bares, V., Blettner, N., Cazzaniga, G., Chwala, C., Colli, M., de Vos, L., El Hachem, A., Galdies, C., Giannetti, F., Graf, M., Jacoby, D., Victor Habi, H., Musil, P., Ostrometzky, J., Roversi, G., Sapienza, F., … Zheng, X. (2024). Data formats and standards for opportunistic rainfall sensors. Open Research Europe, 3, 169. 10.12688/openreseurope.16068.2