A Python-based tool for creating Decision Calendar Plots for Hydrological Forecasting.
This repository contains tools to generate decision calendar visualizations for hydrological forecasting. Decision calendars help river forecast centers, water resource managers and stakeholders understand the timing of key decisions and their relationship to hydrological forecasts.
notebooks/
- Jupyter Notebook for creating decision calendars -config/
- Configuration files in YAML formatchena.yaml
- Configuration for Chena River analysisross.yaml
- Configuration for Ross River analysis
scripts/
- Python scripts for generating decision calendarsdecision_calendars.py
- Main script for creating decision calendar plots
data/
- Data files for streamflow and snow dataoutput/
- Output files for decision calendarsimages/
- Images used in the decision calendars
- Python 3.x
- Required Python packages (recommend creating a virtual environment):
pip install jupyter numpy pandas matplotlib pyyaml pycirclize
-
Clone the repository:
git clone https://github.com/DaveCasson/decision_calendar.git cd decision_calendar
-
Launch Jupyter Notebook:
jupyter notebook
-
Run the notebook
notebooks/decision_calendars.ipynb
to create decision calendars. -
Configure your analysis (and colour schemes) by modifying the YAML files in the
config/
directory to match your specific river system and decision points.
The YAML configuration files in the config/
directory define the parameters for each river system's decision calendar. You can use the existing templates (chena.yaml
and ross.yaml
) as examples for creating configurations for other river systems.
To update colors or styles:
- Modify the hex codes under each relevant section.
- Example: Change
annual_activities.critical_period
from"#896279"
to"#123456"
.
- Example: Change
- Update styles (e.g., line types, markers) in the
styles
section:linestyle
: Options include"-"
(solid),"--"
(dashed),":"
(dotted), or"-."
(dashdot).linewidth
: Adjust thickness (e.g.,3
for thicker lines).marker
: Update to other symbols like"o"
,"P"
, or"v"
.markerfacecolor
: Use colors defined invisualization
or input custom hex codes.
Track configurations define visualization details like colors, line types, and ranges.
- To update specific tracks:
- Change
type
(e.g.,"line"
,"infill"
,"marker"
). - Update
color
using the keys in thecolors
section or custom hex codes. - Modify
linestyle
,linewidth
, andalpha
(transparency). - Adjust
r_start
,r_end
, andmonths
to change placement and duration.
- Example:
hydrological_critical_period: type: "infill" color: "hydrological_forecasting.critical_period" alpha: 0.7 r_start: 65 r_end: 86 months: ["Apr", "May", "Jun", "Jul", "Aug", "Sep"]
- Change
Legend groups control the labels and descriptions for different elements.
- To update:
- Modify
description
for the group title. - Adjust the
color
andlinestyle
for clarity. - Add or remove
elements
as needed:- Use
type
options like"line"
,"marker"
, or"space"
. - Example:
- type: line color: "hydrological_forecasting.forecast" linestyle: "dotted" linewidth: 3 label: "HEFS Forecasts"
- Use
- Modify
To update plot configurations:
- Modify figure size:
- Example: Change
figsize: [30, 16]
to adjust width and height.
- Example: Change
- Update title text under
titles
. - Adjust the legend position (
loc
) and style attributes likefontsize
andedgecolor
.
Contributions are welcome! Please feel free to submit a Pull Request.