Difference between revisions of "Topmodel"

From SourceWiki
Jump to navigation Jump to search
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
[[Category:Projects]]
 +
[[Category:Hydrology in R]]
 +
 
==Introduction==
 
==Introduction==
  
The package TOPMODEL contains some functions and code snippets for hydrological data analysis with R, that may eventually make it into a properly released R package. For now, the code can be downloaded on this page and used at your own risk, without official support (although I very much welcome all feedback). The core of the package is an implementation of the venerable TOPMODEL.
+
The TOPMODEL package contains an implementation of the venerable TOPMODEL, along with some other useful functions. Although the package has been tested extensively, it may contain bugs. All feedback is welcome (see the feedback page).
 
 
Information on R, including downloads, installation and a great choice of manuals can be found on the R website. If you follow strictly the examples used below, you will be able to run TOPMODEL with a very limited R knowledge. However, R has a great potential for pre- en postprocessing of the data (including uncertainty analysis and statistics), so a more extensive knowledge of R is highly recommended!
 
 
 
Thanks go to Keith Beven, who wrote the original TOPMODEL in Fortran, and Huidae Cho, for the C code base (originally implemented in GRASS GIS)
 
 
 
For a fully documented example, see the [[hydrology in R]] pages
 
  
 +
Thanks go to [http://www.lec.lancs.ac.uk/cswm/Staff_kb.php Keith Beven], who wrote the original TOPMODEL in Fortran, and [http://geni.ath.cx/ Huidae Cho], for the C code base (originally implemented in [http://grass.osgeo.org/ GRASS GIS])
  
==Downloads==
+
For a fully documented example, see the [[Running Topmodel]] page.
 
 
* [http://www.paramo.be/topmodel/topmodel_0.3.zip Windows binary (experimental)]
 
* [http://www.paramo.be/topmodel/topmodel_0.3.tar.gz Linux source package]
 
* [http://www.paramo.be/topmodel/topmodel_0.3.tgz Universal MacOS X package (experimental)]
 
  
 
==Installation==
 
==Installation==
  
===Windows===
+
Topmodel is available from the [http://cran.r-project.org/mirrors.html Comprehensive R Archive Network]. It can be installed directly from within R with:
  
Local packages can be installed from the menu. Choose "install package(s) from local zip files" and select the downloaded topmodel_0.3.zip file.
+
  install.packages("topmodel")
  
===Linux===
+
==Loading==
  
Use the normal procedure of installing a package in R:
+
Once in R you need to load the package before you can use it:
  
   > R CMD install topmodel_0.3.tar.gz
+
   library(topmodel)
  
Developer tools, including gcc, must be installed.
+
==Function overview==
  
===Mac===
+
Full documentation is provided in the package, and can be opened with:
  
Go to the Package Installer (Packages and Data menu), select "Local Binary Package", click install and select the downloaded package
+
  help.start()
  
==Loading==
+
The current version contains the following functions:
  
Once in R you need to load the package before you can use it:
+
* ''infiltration()'' gives direct access to the Green-Ampt infiltration routine used by topmodel
 +
* ''make.classes()'' makes topographic index classes from a topographic index map
 +
* ''NSeff()'' calculates the Nash-Sutcliffe efficiency
 +
* ''topidx()'' calculates the topographic index from a raster DEM
 +
* ''topmodel()'' implements the original model
  
  > library(topmodel)
+
==Raw libraries==
  
==Function overview==
+
The package is in fact a wrapper around a set of C libraries. This makes it easy to recycle the libraries and link them in C programs or other languages (Fortran, C++, Python, ...). For access to the libraries, download the [http://cran.r-project.org/src/contrib/topmodel_0.5.tar.gz source package], extract it, and look into the src/ subdirectory.
  
For the full documentation, see the installed manpages in R
+
Only the file topmodel.c contains some R-specific functions (they start with R_) related to output in the R console. This file implements the monte-carlo simulation. The model itself can be found in core_topmodel.c and subroutines.

Latest revision as of 14:54, 11 February 2009


Introduction

The TOPMODEL package contains an implementation of the venerable TOPMODEL, along with some other useful functions. Although the package has been tested extensively, it may contain bugs. All feedback is welcome (see the feedback page).

Thanks go to Keith Beven, who wrote the original TOPMODEL in Fortran, and Huidae Cho, for the C code base (originally implemented in GRASS GIS)

For a fully documented example, see the Running Topmodel page.

Installation

Topmodel is available from the Comprehensive R Archive Network. It can be installed directly from within R with:

 install.packages("topmodel")

Loading

Once in R you need to load the package before you can use it:

  library(topmodel)

Function overview

Full documentation is provided in the package, and can be opened with:

  help.start()

The current version contains the following functions:

  • infiltration() gives direct access to the Green-Ampt infiltration routine used by topmodel
  • make.classes() makes topographic index classes from a topographic index map
  • NSeff() calculates the Nash-Sutcliffe efficiency
  • topidx() calculates the topographic index from a raster DEM
  • topmodel() implements the original model

Raw libraries

The package is in fact a wrapper around a set of C libraries. This makes it easy to recycle the libraries and link them in C programs or other languages (Fortran, C++, Python, ...). For access to the libraries, download the source package, extract it, and look into the src/ subdirectory.

Only the file topmodel.c contains some R-specific functions (they start with R_) related to output in the R console. This file implements the monte-carlo simulation. The model itself can be found in core_topmodel.c and subroutines.