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/CH-Earth/hydro_decision_calendars.git cd decision_calendar -
Launch Jupyter Notebook:
jupyter notebook
-
Run the notebook
notebooks/decision_calendars.ipynbto 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_periodfrom"#896279"to"#123456".
- Example: Change
- Update styles (e.g., line types, markers) in the
stylessection:linestyle: Options include"-"(solid),"--"(dashed),":"(dotted), or"-."(dashdot).linewidth: Adjust thickness (e.g.,3for thicker lines).marker: Update to other symbols like"o","P", or"v".markerfacecolor: Use colors defined invisualizationor 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
colorusing the keys in thecolorssection or custom hex codes. - Modify
linestyle,linewidth, andalpha(transparency). - Adjust
r_start,r_end, andmonthsto 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
descriptionfor the group title. - Adjust the
colorandlinestylefor clarity. - Add or remove
elementsas needed:- Use
typeoptions 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 likefontsizeandedgecolor.
Contributions are welcome! Please feel free to submit a Pull Request.
If you use or reference this software in your work, please cite it as follows:
APA style (for general use):
Casson, D. (2025). CH-Earth/hydro_decision_calendars: version 1.0 release (Version 1.0) [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.16883445
BibTeX (for LaTeX users):
@software{casson_2025_hydro_decision_calendars,
title = {CH-Earth/hydro\_decision\_calendars: version 1.0 release},
author = {Casson, Dave},
year = {2025},
month = aug,
version = {1.0},
publisher = {Zenodo},
doi = {10.5281/zenodo.16883445},
url = {https://doi.org/10.5281/zenodo.16883445}
}
