Quick Start

The easiest way to start using the package is to install it using pip install rainfallqc.

To use RainfallQC in a project, a polars dataframe can be directly input to the QC checks like:

import polars as pl
import rainfallqc.gauge_checks

data = pl.read_csv("path/to/your/rain_gauge_data.csv")
flags = rainfallqc.gauge_checks.check_intermittency(data, target_gauge_col="rain_mm")

All quality control checks in the RainfallQC package begin with check_

Content overview

RainfallQC contains six modules:

  1. gauge_checks - For detecting abnormalities in summary and descriptive statistics.

  2. comparison_checks - For detecting abnormalities by comparing to benchmark data.

  3. timeseries_checks - For detecting abnormalities in patterns of the data record.

  4. neighbourhood_checks - For detecting abnormalities based on measurements in neighbouring gauges.

  5. subhourlyqc_checks - An extension for IntenseQC to be applied to sub-hourly rainfall data.

  6. pypwsqc_filters - For applying quality assurance protocols and filters for rainfall data.

You can find a jupyter notebook with an easy-to-follow example here

Which checks are suitable for my data’s temporal resolution?

As you can imagine, not all quality control checks are suitable for all temporal resolutions. Therefore, we have created a table that shows which checks are suitable for which temporal resolutions, and which can be applied after aggregating data (“agg”) to a coarser temporal resolution.

Which checks are suitable for my data’s time-resolution

Short name

Long name

<15-min

15-min

hourly

daily

monthly

QC1

Percentiles

QC2

K-largest

QC3

Days of week

QC4

Hours of day

QC5

Intermittency

QC6

Breakpoints

QC7

Minimum value change

QC8

R99p

QC9

PRCPTOT

QC10

World Record

QC11

Rx1day

QC12

CDD (Dry spells)

QC13

Daily accumulations

agg

agg

QC14

Monthly accumulations

QC15

Streaks

agg

agg

QC16

Daily neighbours (wet)

QC17

Hourly neighbours (wet)

QC18

Daily neighbours (dry)

QC19

Hourly neighbours (dry)

QC20

Monthly neighbours

agg

agg

agg

agg

QC21

Timing offset

QC22

Pre-QC affinity index

QC23

Pre-QC pearson correlation

QC24

Daily factor

agg

agg

agg

QC25

Monthly factor

agg

agg

agg

agg

HQC_UK1hr

Check exceedance of UK 1h record

HQC_UK24hr

Check exceedance of UK 24h record

HQC_UK24hr_rolling

Check 24h-sum exceedance of UK 24h record

HQC_streaks_20mm

Check streaks (20 mm min)

SHQC_freqResChecker

Check data has sub-hourly frequency

SHQC_subH_checkr

Check sub-hourly rainfall thresholds

FZ

Faulty Zeros

SO

Station Outliers