ridal 0.5.0

Speeding up Ground Penetrating Radar (GPR) processing
Documentation

PyPI Crates.io CI

Ridal — Speeding up Ground Penetrating Radar (GPR) processing

The aim of ridal is to quickly and accurately process GPR data. In one command, most data can be processed in pre-set profiles or with custom filter settings, and batch modes allow for sequences of datasets to be processed with the same settings. Built in rust with a high focus on testing and performance, ridal may be for you if large data volumes and strange fileformats are common issues.

The name is a take on the loosely defined "Data Abstraction Library" (DAL) projects like GDAL and PDAL, but for radar. A near-term goal of Ridal is to enable easy conversion between formats, such as ridal convert input.rad output.dzt (this is not yet implemented).

Much of the functionality has been inspired from the projects RGPR and ImpDAR; both of which are more mature projects. For example, Ridal currently only works on Malå (.rd3) and pulseEKKO (.dt1) radar formats. For many uses, these will more likely be the tools for you!

Image of a glacier radargram Radargram (100 MHz Malå) of Kroppbreen in Svalbard. Collected 28 Feb. 2023.

Notes

  • Prior to Feb. 2026, this program was called rsgpr.
  • The CLI/Python interface changed completely in version 0.5. See Issue #82 for more info.

Installation

Requirements

  • cargo(only for the CLI; not the python package). Easiest installed using rustup.
  • gdal (optional, for sampling heights from DEMs). For Debian or derivatives, this means gdal-bin.
  • proj (optional, for CRS support other than WGS84 UTM Zones). For Debian or derivatives, this means proj-bin.

Using cargo, the ridal CLI can be installed (after installing the requirements):

cargo install ridal

with nix, the flake can be used without worrying about the requirements above:

inputs = {
  ridal.url = "github:erikmannerfelt/ridal";
};

or in an ephemeral shell:

nix shell github:erikmannerfelt/ridal

Python

There's an early implementation of a Python package:

pip install ridal
>>> import ridal
# Print useful info as a dictionary
>>> ridal.info("path/to/file.rad")
'{...}'
# Process and save to a file
>>> ridal.process("path/to/file.rad", steps=["zero_corr", "auto_gain"], output="processed.nc")
# Process and load into memory
>>> ridal.process("path/to/file.rad", steps=["zero_corr"], return_dataset=True, return_dataset_format="xarray")
<xarray.Dataset> Size: ...
Dimensions:     (y: ..., x: ...)
Coordinates:
...
# Only load into memory with no processing
>>> ridal.read("path/to/file.rad", return_dataset_format="xarray")
<same as above>

See scripts/render_kroppbreen.py for an example of how it can be used.

Simple CLI usage

See the help page of ridal for info on how to interact with the CLI:

ridal -h

To toggle useful information on a file, the info subcommand shows the metadata and a summary of the location data:

ridal info DAT_001_A1.rd3

Processing a file using the default processing profile:

ridal process DAT_001_A1.rd3 --default

All processing steps are shown in the steps.md file. It can also be printed with ridal steps.

A processing step pipeline is defined using ridal process file.rad --steps "zero_corr,dewow,..." or using a file: --steps steps.txt:

subset(1 100) # Comments are supported!
zero_corr
dewow

correct_topography

The output will be a NetCDF file with the same name but an .nc suffix. By default, the output is saved in the same directory as the input. For more control, the output directory and/or filename can be controlled with -o or --output.

To process multiple files in "batch mode", provide a "glob" pattern as the filename. Optionally, for many sequential files, the --merge argument allows merging multiple files into one.

ridal batch-process data/*.rd3 --merge "10 min" --default -o output/

A rudimentary profile renderer is available with the -r argument. This will be saved in the same location as the output file as a JPG if another filename is not given.

Papers using Ridal

... and many others in preparation/review