-
Notifications
You must be signed in to change notification settings - Fork 122
Home
OpenDrift is a software for modeling the trajectories and fate of objects or substances drifting in the ocean, or even in the atmosphere.
OpenDrift is open source, and is programmed in Python. As the software is very generic, it is rather a "framework" than a "trajectory model" in the traditional sense. Trajectory models for specific purposes (e.g. oil drift, search and rescue, larvae drift etc) may reuse all common functionality from the core model, and need only implement a Python Class describing the purpose-specific processes (physics/biology etc). See Requirements and Data model for more detailed information.
A journal paper about OpenDrift is published in Geoscientific Model Development. A paper describing the technical details of the oil spill module OpenOil is published in Ocean Science.
- Open source, GPL v2 license, providing full transparency - no black boxes
- Platform independent, runs on Linux, Mac/OS X, Windows
- Python2 and Python3 compliant
- Fast - typical simulation time is ~30 seconds for a 66 hour simulation with 1000 particles
- Modular, may simulate transport and fate of any kind of of particles (oil, ships, persons, icebergs etc.)
- Simple to make new modules, based on existing modules or blank template
- May use input forcing data (e.g. current, wind and waves) from any model, in any file format and any map projection
- avoids need to preprocess driver data
- map reprojection and vector rotation performed on-the-fly, using PyProj library
- may use input forcing from remote datasets (e.g. Thredds)
- May use backup driver models (e.g. current, wind, waves) for robustness if first choice is not available
- May run backwards in time by simply specifying a negative time step
- Output saved to CF-compliant netCDF files (but export modules may be written for other formats).
- Basic graphical user interface (presently supports only OpenOil and Leeway)
- Input from ensemble models
OpenDrift is under active development, and issues may occur. Please submit a bug report if you encounter a problem.
There are currently two active branches of OpenDrift, stable
which supports Python 2, and master
which will soon loose Python 2 support.
OpenDrift can be installed through PyPA, conda or directly from the source repository. The latter is preferred if you expect to make changes to the OpenDrift models or code base.
Consider setting up an exclusive virtual environment for OpenDrift.
$ pip install gitpython sqlalchemy zope.sqlalchemy==1.1 transaction numpy scipy https://github.com/NOAA-ORR-ERD/PyNUCOS/archive/v2.5.5.tar.gz awesome-slugify # dependencies for the NOAA oil library
$ pip install git+https://github.com/OpenDrift/OilLibrary@3f65a60fd4543a8b772622c245b4b3c25d4b8f38 # opendrift version of oillibrary (python 3 version)
$ pip install opendrift
- Install miniconda3
- Set up environment and install OpenDrift:
$ conda env create -n opendrift -c opendrift -c conda-forge -c noaa-orr-erd python=3 opendrift
- Check out source
$ git clone https://github.com/OpenDrift/opendrift.git
- Use either conda or pip to install dependencies (including the NOAA ADIOS OilLibrary):
conda:
$ conda env create --file conda_python3.yml
pip:
$ pip install -r requirements.txt
- Install OpenDrift locally:
$ pip install -e . # from source root
For a demonstration of various capabilities, run some of the executable example scripts located in the subfolder examples. Some of the scripts use sample netCDF files provided in the test_data folder, and others obtain data from online resources (Thredds). If this works well, you may play with the model by editing the example scripts.
Here is a detailed explanation of the steps involved when running the model.
If you installed OpenDrift from source you can test that everything works as expected by running the script testall
in the root folder.
The last line of the output should report that all tests have been executed successfully.
OpenDrift is licensed under GPL v2.0
If you have found OpenDrift useful for your study, please cite it as:
For the oil spill module OpenOil, please cite in addition to above:
Please create an issue or contact [email protected] for any questions.
Click here if you want to receive emails about important changes or releases.