Skip to content

PyPrecip is a Python library to download, process, and build AI models for precipitation nowcasting and forecasting. It will start with station-based precipitation and later add radar-based precipitation.

License

Notifications You must be signed in to change notification settings

mehmetbercan/PyPrecip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌧️ PyPrecip

License: Research-Only Python Status

PyPrecip is a Python toolkit for precipitation nowcasting and forecasting.
It provides tools to download, process, and model precipitation data using AI-driven pipelines.

🧪 Currently supports station-based precipitation (radar support coming soon).


🚀 Features

  • 📥 Data downloaders (coming soon)
  • 🧹 Preprocessing and feature‑engineering pipelines
  • 🧠 Baseline and advanced AI models for nowcasting
  • 📈 Forecasting models (planned)
  • 🧪 Evaluation metrics, visualization, and interactive tools

⚙️ Installation

If you’re new, please read Help for Novice Users.md first.
Then open a terminal (Command Prompt or PowerShell) in your project root (where pyproject.toml is) and run:

pip install -e .

🧩 Running Tests

cd PyPrecip/tests
pytest test_cli_organize.py::test_organize_tr_cmd
pytest test_cli_create_training.py::test_create_training_cmd
pytest test_cli_train_cum_evnt.py::test_train_cum_evnt_cmd

💻 Command‑Line Interface (CLI)

Note:
When using -c file/to/yaml, make sure the specified YAML configuration file exists and is up‑to‑date for that command.

1️⃣ Organize Raw Data

Organize mixed precipitation data (e.g., from the Turkish State Meteorological Service) into the standard PyPrecip format:

pyprecip organize-tr -c examples/configs/organizer_tr_example.yaml

2️⃣ Create Training Inputs

Generate event‑based training inputs from the organized data:

pyprecip create-training -c examples/configs/create_training_example.yaml

🧭 2.1  Interactive Config Builder

Launch the interactive visualization tool to build or adjust a YAML config before running the command above:

pyprecip config-builder-4-create-training -i D:/PROJECTS/PyPrecip/examples/outputs/organized

3️⃣ Train CNN Model

Train a convolutional model optimized for event‑based input (architecture config in YAML):

pyprecip train-cum-evnt -c examples/configs/train_cum_evnt_example.yaml

🎨 3.1  Interactive Training Data Visualizer

Open the visualizer to explore target (y) data and fine‑tune class ranges homogeneously.
Once intervals are updated, you can reuse the new YAML configuration from this tool when running train-cum-evnt.

pyprecip training-data-visualizer -c D:/PROJECTS/PyPrecip/examples/configs/train_cum_evnt_example.yaml

🎨 3.2 Interactive AI Model Visualizer

Use the interactive visualizer to explore your trained AI model, review performance metrics, and understand its behavior.

pyprecip trained-aimodel-visualizer -c D:/PROJECTS/PyPrecip/examples/configs/train_cum_evnt_example.yaml  

This command loads the trained model, its recorded training history, and the test dataset defined in the configuration file.
The Dash-based web interface provides an intuitive environment to analyze model performance.

Within the visualizer, you can:

  • Review key performance metrics (ACC, RMSE, RSE, POD, FAR, CSI) calculated on test data.
  • Inspect training and validation accuracy/loss curves to assess learning stability.
  • Examine confusion matrices (counts and percentage, test data) to evaluate prediction accuracy across rainfall categories.
  • Explore the prediction probability explorer (test data) to visualize confidence levels and identify common misclassification patterns.

🧠 Notes

  • All CLI commands support the -c flag for YAML‑based configs.
  • Interactive tools enable dynamic inspection + editing of parameters.
  • Radar‑based datasets and forecasting models are in active development.

🧾 License

This research code is distributed under a Research‑Only License.
See the license badge or accompanying documentation for details.

About

PyPrecip is a Python library to download, process, and build AI models for precipitation nowcasting and forecasting. It will start with station-based precipitation and later add radar-based precipitation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages