Download this notebook: 01_elbow_precipitation_analysis.ipynb
01 - Precipitation Reanalysis#
Learning goals of this module#
Learn how to do a basic analysis, comparing observed precipitation with reanalysis precipitation from RDPA and HRDPA
Learn how to run a simple example to access and compare observed and reanalysis precipitation.
Learn how to calculate and visualize simple error metrics
Assumptions#
We assume you are familiar with the concept of a reanalysis product.
Reference to reanalysis products#
Run imports and set-up logging#
[2]:
import logging
import sys
import warnings
from pathlib import Path
from dotenv import load_dotenv
from veriflow import run_pipeline
from veriflow.constants import VERSION
# add project root (parent of notebook folder) to path
sys.path.append(str(Path("..").resolve()))
from verification_plots import (
reanalysis_timeseries_plot,
)
# Reload automatically
%load_ext autoreload
%autoreload 2
warnings.filterwarnings("ignore", category=RuntimeWarning)
warnings.filterwarnings("ignore", category=FutureWarning)
load_dotenv(dotenv_path="tutorial.env", override=True)
base_config = Path("config")
base_config.exists()
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s - %(levelname)s - %(message)s",
handlers=[logging.StreamHandler()],
)
logging.info(f"Running Veriflow version {VERSION}")
2026-06-18 22:29:50,163 - INFO - Running Veriflow version 0.1.0
The autoreload extension is already loaded. To reload it, use:
%reload_ext autoreload
Inspecting the veriflow pipeline configuration#
Open the config file in the “config” directory. The name of the file is identical to the name of the notebook.
Inspect each of the sections to gain an understanding of what this configuration is about.
We are pulling from FEWS webservices (you will see this as downloads from urls)
Station Observations
RDPA Analysis at Stations
HRDPA Analysis at Stations
Running the veriflow pipeline#
[3]:
config_file = base_config / "01_elbow_precipitation_analysis.yaml"
ods = run_pipeline(config=(config_file, "yaml"))
2026-06-18 22:29:50,486 - INFO - Successfully initialized the configuration.
verification_period_start = 2026-05-15 00:00:00
verification_period_end = 2026-06-08 00:00:00
2026-06-18 22:29:50,532 - INFO - Start getting data from FewsWebservice.
2026-06-18 22:29:51,712 - INFO - Successfully got data from FewsWebservice.
2026-06-18 22:29:51,714 - INFO - Start getting data from FewsWebservice.
2026-06-18 22:29:52,399 - INFO - Successfully got data from FewsWebservice.
2026-06-18 22:29:52,400 - INFO - Start getting data from FewsWebservice.
2026-06-18 22:29:52,946 - INFO - Successfully got data from FewsWebservice.
2026-06-18 22:29:52,950 - INFO - Successfully loaded all data from sources.
2026-06-18 22:29:52,983 - INFO - Successfully computed ContinuousScores for verification pair PC_RDPA.
2026-06-18 22:29:53,021 - INFO - Successfully computed ContinuousScores for verification pair PC_HRDPA.
2026-06-18 22:29:53,023 - INFO - Verification pipeline completed successfully.
Evaluating the results in the veriflow OutputDataset#
A good starting point for “eyeball” verification is simple: just looking at your observations and re-analysis in a visual way. Use the interactive elements in the plots below to zoom, pan and compare the results of our 2 re-analysis products.
1 - Check out the stations in the OutputDataset#
[4]:
stations = ods.get(ods.verification_pairs[0]).coords["station"].values
print(f"Stations: {stations}")
Stations: ['3031092' '3050778' 'MSC-005' '05BL813' '05BJ804' '05BL809' 'FIRES-B4'
'05BJ805' '05BL812' 'FIRES-B5' '05BJ806' '05BH803' '05BF825' '05BH802'
'05BL810' '05BF827']
2 - Visualize the precipitation (per station)#
[5]:
reanalysis_timeseries_plot(ods, station=stations[5])
3 - Visualize the precipitation (per station) and add the absolute error to the plot as well#
[6]:
reanalysis_timeseries_plot(ods, station=stations[4], error_var="mae")