Welcome to IBMWeatherGen, a powerful gridded, multisite, multivariate, and daily stochastic weather generator based on resampling methodology written in Python
To get started, follow these steps:
-
Clone the Repository: Begin by cloning this repository to your local machine.
-
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
-
Install Dependencies: Install the required dependencies by executing the following command:
pip install -r requirements.txt
Follow these steps to run tests:
-
Unzip the Dataset: Unzip the provided dataset named
dset_wg_d.csv.zip
and place it in the/data
directory. -
Navigate to Source Directory: Move to the
src
directory in the terminal. -
Run Simulation: Execute the simulation by running the following command:
python execute_IBMWeatherGen_json.py
This will generate simulations stored in the simulation
folder.
To customize the weather generator according to your needs:
-
Weather Dataset: Prepare a weather dataset in the same format as the provided dataset (
dset_wg_d.csv
). -
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.
-
Maria Julia de Castro Villafranca Garcia
- GitHub: mairju
-
Jorge Luis Guevara Diaz
- GitHub: jorjasso
- Email: [email protected]
-
Leonardo Tizzei
- GitHub: ltizzei
- Email: [email protected]
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:
- WeatherGen: walkerjeffd.github.io/weathergen/