Git Product home page Git Product logo

hemiphoto2lai's Introduction

DOI

hemiphoto2LAI (a beta version): An R package for estimating leaf area index & leaf angle distribution from hemiphotos


Description

Digital hemispherical photography (i.e., hemiphoto) is a convenient, rapid tool to estimate two key canopy structure parameters: leaf area index (LAI) and leaf angle distribution (LAD). Underlying such use of hemiphotos is a gap probability model widely known as either the Poisson model or Beer's Law for describing light-vegetation interactions. Based on this gap formula, numerous algorithms have been developed to convert hemiphotos into LAI and LAD. The hemiphoto2LAI package implements a total of 135 LAI estimation models, including the majority of classical algorithms proposed during the past several decades and more importantly, a newly proposed binary nonlinear regression algorithm (BNR). The implemented algorithms are adopted to a total of 19 common leaf angle distribution models. Details on the BNR algorithm and the package can be found in Zhao et al. (2019).


Installation

There are three ways to install the hemiphoto2LAI R package.

1. CRAN

hemiphoto2LAI will be submitted to CRAN soon. Once it is available there, you can install it with:

install.packages("hemiphoto2LAI")

2. GitHub

You can alternatively install the development version of hemiphoto2LAI from GitHub as follows:

if (!require(devtools)) install.packages('devtools')
devtools::install_github("zhaokg/hemiphoto2LAI")

Note that the avove will install "hemiphoto2LAI" from source. Becaues hemiphoto2LAI was written in the mixed use of C/C++ and Fortran. You need to make sure your machine is able to have a C and a Fotran compiler appropriately set up. For example, see Package Development Prerequisites for the tools needed for your operating system. In particular, on Windows platforms, the most convenient option is to go with the Rtools toolkit.

3. Pre-compiled binary

For those users or machines that cann't build the package from source, we will provide pre-compiled binary packages for you to install

Windows x86 or x64

install.packages("https://raw.github.com/zhaokg/hemiphoto2LAI/master/precompiled_binary/hemiphoto2LAI_0.1.zip" ,repos=NULL)

Debian Linux x86 x64

install.packages("https://raw.github.com/zhaokg/hemiphoto2LAI/master/precompiled_binary/hemiphoto2LAI_0.1_R_x86_64-pc-linux-gnu.tar.gz" ,repos=NULL)

Ubuntu Linux x86 x64

install.packages("https://raw.github.com/zhaokg/hemiphoto2LAI/master/precompiled_binary/hemiphoto2LAI_0.1_R_x86_64-pc-linux-gnu_ubuntu.tar.gz" ,repos=NULL)

Mac

install.packages("the link is coming" ,repos=NULL)

Usage

The main function of this package is "estimateLAI". Below are examples to show how to use it.

library(hemiphoto2LAI)

#--------------------------------Example 1--------------------------------#
data(sampleGapData) #will load two variables, THETA and GAP, into the R environment
plot(sampleGapData$THETA, sampleGapData$GAP)
result=estimateLAI(sampleGapData$THETA, sampleGapData$GAP)
#*****************************End of Example 1****************************#
 
#--------------------------------Example 2--------------------------------#
data(sampleGapData) #will load two variables, THETA and GAP, into the R environment
 
opt=list()         #Create an empty list to append individual parameters
opt$ite=200        #the max number of iteration in the conjugate-gradient opitimer
                   #used to estimate the best LAI and LAD parameers.
opt$gq_knotNum=21  #The number of knots for the Gaussian quadrature (GP). GP is used when
                   #the LAD model chosen does not have an analyticak form and therefore has to
                   #evaluated numerically by integrating the associated g(\theta) function.
opt$nfrac=8        # The number of annuli/zenith intervals chosen to divide the full zenith and
                   # caculate annulus-level gap fractions. These fractions are the direct input
                   # to all the LAI algorithms except the binary nonlinear regression algorithm.

result=estimateLAI(sampleGapData$THETA, sampleGapData$GAP,opt)
#*****************************End of Example 2****************************#

Reporting Bugs

hemiphoto2LAI is distributed as is and without warranty of suitability for application. The one distribubuted above is a beta version, with potentail room for further improvement. If you encounter flaws with the software (i.e. bugs) please report the issue. Providing a detailed description of the conditions under which the bug occurred will help to identify the bug. *Use the Issues tracker on GitHub to report issues with the software and to request feature enchancements. Alternatively, you can directly email the package maintainer Dr. Kaiguang Zhao at [email protected].

hemiphoto2lai's People

Contributors

zhaokg avatar

Stargazers

 avatar  avatar Lachezar Filchev avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.