Skip to content

metno/wxgen

Repository files navigation

Weather generator software

https://travis-ci.org/metno/wxgen.svg?branch=master https://coveralls.io/repos/metno/wxgen/badge.svg?branch=master&service=github

wxgen is a command-line tool for generating arbitrarily long weather time-series. The generator produces gridded output for multiple variables (e.g. temperature, precipitation) and aims to have realistic covariances in space, time, and across variables.

The generator uses a database of past weather model simulations (e.g 15 day forecasts) and combines the segments stochastically. Longer trajectories are created by concatenating the shorter trajectories from the database. This is done by matching the end state of one trajectory with the beginning state of another. The matching is done using a specified metric, such as the sum of the square differences between states (with some kind of normalization strategy as each atmospheric variable has different variances).

Documentation

For information about how to use wxgen, check out the wiki page at https://github.com/metno/wxgen/wiki

Features

Example plot

Installating on Ubuntu

Prerequisites

Install the required pacakges:

sudo apt-get update
sudo apt-get install netcdf-bin libnetcdf-dev libhdf5-serial-dev
sudo apt-get install python-setuptools python-pip
sudo apt-get install python-numpy python-scipy python-matplotlib python-mpltoolkits.basemap

Installing using pip

After this, the easiest is to install the latest version of wxgen using pip:

sudo pip install wxgen

This will create the executable /usr/local/bin/wxgen. If /usr/local/bin is not in your PATH environment variable, then add it (i.e add export PATH=/usr/local/bin/:$PATH to ~/.bashrc). If you do not have sudo privileges do:

pip install wxgen --user

This will create the executable ~/.local/bin/wxgen. Add this to your PATH environment variable if necessary (i.e add export PATH=$PATH:~/.local/bin to ~/.bashrc).

If at a later time you wish to update to a newer release, do:

pip install wxgen --upgrade

(adding --user if appropriate)

Installing from source

Alternatively, to install from source, download the source code of the latest version: https://github.com/metno/wxgen/releases/. Unzip the file and navigate into the extracted folder.

Then install wxgen by executing the following inside the extracted folder:

sudo pip install -r requirements.txt
sudo python setup.py install

If you are working on the code, the -e flag ensures that you do not need to rerun pip install every time you make changes to the code:

sudo pip install -e .

Again, if you do not have sudo privileges, remove sudo and append --user to the previous pip and python commands.

Copyright and license

Copyright (C) 2017 MET Norway. Wxgen is licensed under LGPL version 3 or (at your option) any later version.