Skip to content

A daily stochastic weather generator based on resampling methodology

License

Notifications You must be signed in to change notification settings

kora-labs/IBMWeatherGen

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IBMWeatherGen: Stochastic Weather Generator Tool

Welcome to IBMWeatherGen, a powerful gridded, multisite, multivariate, and daily stochastic weather generator based on resampling methodology written in Python

Setup

To get started, follow these steps:

  1. Clone the Repository: Begin by cloning this repository to your local machine.

  2. Create and Activate Virtual Environment: Set up a virtual environment using your preferred tool (conda, pyenv, virtualenv, etc.). Here's an example using conda:

    conda create -n wg-env python=3.8.14
    conda activate wg-env
    
  3. Install Dependencies: Install the required dependencies by executing the following command:

    pip install -r requirements.txt
    

Running Tests

Follow these steps to run tests:

  1. Unzip the Dataset: Unzip the provided dataset named dset_wg_d.csv.zip and place it in the /data directory.

  2. Navigate to Source Directory: Move to the src directory in the terminal.

  3. Run Simulation: Execute the simulation by running the following command:

    python execute_IBMWeatherGen_json.py
    

This will generate simulations stored in the simulation folder.

Customization

To customize the weather generator according to your needs:

  1. Weather Dataset: Prepare a weather dataset in the same format as the provided dataset (dset_wg_d.csv).

  2. Edit Input Parameter File: Modify the input parameter file with your desired settings:

    {
        "PATH_FILE_IN": "../data/dset_wg_d.csv",
        "PATH_FILE_OUT": "../simulations/",
        "START_YEAR": 2010,
        "NUM_YEARS": 10,
        "NUM_SIMULATIONS": 5,
        "WET_EXTREME": 0.999
    }
    

Where:

  • PATH_FILE_IN: Path to the weather data used for training the generator.
  • PATH_FILE_OUT: Path to store generated simulations.
  • START_YEAR: Starting year for simulations.
  • NUM_YEARS: Number of years to simulate ahead.
  • NUM_SIMULATIONS: Number of simulation sets.
  • WET_EXTREME: Threshold for extreme events.

Authors

References

We have employed this implementation for conducting experiments detailed in our paper:

  • Jorge Luis Guevara Diaz, Maria Garcia, et al. Direct Sampling for Spatially Variable Extreme Event Generation in Resampling-Based Stochastic Weather Generators. JAMES, 2023.

To enhance your understanding, we recommend exploring the following references:

  • Steinschneider, Scott et al. "A semiparametric multivariate, multisite weather generator with low-frequency variability for use in climate risk assessments." DOI: 10.1002/wrcr.20528 (2013).

  • Apipattanavis, Somkiat et al. "A semiparametric multivariate and multisite weather generator." DOI: 10.1029/2006WR005714 (2007).

  • Kwon, Hyun-Han et al. "Stochastic simulation model for nonstationary time series using an autoregressive wavelet decomposition: Applications to rainfall and temperature." DOI: 10.1029/2006WR005258 (2006).

  • Rajagopalan, Balaji et al. "A k-nearest-neighbor simulator for daily precipitation and other weather variables." DOI: 10.1029/1999WR900028 (1999).

A single-site weather generator in R that inspired this work:

About

A daily stochastic weather generator based on resampling methodology

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%