Skip to content


Subversion checkout URL

You can clone with
Download ZIP
nesC Python

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.

OOICI Coverage Model

Initial coverage model implementation

Reference Information:


This assumes basic development environment setup (git, directory structure). Please follow the "New Developers Tutorial" for basic steps.

Install the following if not yet present:

Install git 1.7.7: Download the Mac or Linux installer and run it

OS Packages and package management: For Mac, use homebrew

/usr/bin/ruby -e "$(curl -fsSL"
  • python 2.7
  • hdf5
  • netcdf

Install python, hdf5 and netcdf with Homebrew

brew install python hdf5 netcdf

You'll also need the various dependencies of the pyon project:

brew install libevent libyaml zeromq couchdb rabbitmq pkg-config

You can even reinstall git using brew to clean up your /usr/local directory Be sure to read the pyon README for platform specific guidance to installing dependent libraries and packages. Linux: Note that many installs have much older versions installed by default. You will need to upgrade couchdb to at least 1.1.0.

Python packages and environment management:

Install pip

easy_install pip

Install virtualenv and virtualenvwrapper modules for your python 2.7 installation Note: This may require Mac's XCode (use XCode 3.3 free version

easy_install --upgrade virtualenv
easy_install --upgrade virtualenvwrapper

Setup a virtualenv to run coverage-model (use any name you like):

mkvirtualenv --python=python2.7 coverage_model

Optional: To run any of the example functions that result in graphical output, you must also install matplotlib

pip install matplotlib


The coverage model requires that the *pyon** project be available locally in the same directory as coverage-model. If you don't already have the project:*

git clone

Obtain the coverage-model project by running:

git clone
cd coverage-model


Ensure you are in a virtualenv prior to running the steps below

From the coverage-model directory, run the following commands:

git submodule init
git submodule update

Once those steps complete, you should be able to import the coverage model from the python shell:

bin/pycc # or bin/ipython
from coverage_model.coverage import SimplexCoverage

Running the example functions

The coverage_model/test/ module contains 2 functions that can be used to generate 'exemplar' coverages from sample netcdf files (in the test_data directory).

Start an ipython shell session from the root coverage-model directory:

cd your/code/path/coverage-model

From the ipython prompt, run:

from coverage_model.test.examples import *
stn_cov, _ = ncstation2cov() # Generates a coverage from the test_data/ file
print stn_cov

grid_cov, _ = ncgrid2cov() # Generates a coverage from the test_data/ file
print grid_cov

Coverages can be saved and loaded using the respective classmethods of SimplexCoverage:

from coverage_model.coverage import SimplexCoverage

# Load a saved coverage
scov = SimplexCoverage.load('test_data/usgs.cov')

# Make some changes, like adding 10 additional timesteps

# Then save the coverage again, 'test_data/usgs.cov')
Something went wrong with that request. Please try again.