simHemiphoto: Simulation of a hemiphoto

Description Usage Arguments Value References Examples

View source: R/simHemiphto.R

Description

Generate a random hemiphoto of gap vs non-gap for a chosen leaf angle distribution model.

Usage

1
    simHemiphoto(ladType, ladParameter, option=list(),...)

Arguments

ladType

a three-leter string to specify one of the 19 LAD models supported (e.g., "es1","uni",and "lan"). Type print(LAD_list) to see more details about all the 19 possible LAD models.

ladParameter

a vector of two elements specifying the parameter values of the chosen LAD type ladType. NAs should be filled if the LAD model is parameter-free or has just one parameter. Type print(LAD_list) to get more information about the valid parameter ranges for the 19 LAD models.

option

(optional). If absent, simHemiphoto will use default model parameters. If option is present, it must be a list variable specifying three input paramaters for the simulation algorithm. Possible parameters are option$LAI–LAI, option$imageSize–the image size, and option$scaledParameter– a binary variable being either 1 or 0 to indicate how to interpret the second argument ladParameter.

...

additional parameters, not used currently but reserved for future extension

Value

The output is a LIST object,comprising the following elements:

imageTHETA

a square matrix of dimension option$imageSize x option$imageSize . It is the simulated image with pixel values indiciating zenith angles.

imageGAP

a square matrix of dimension option$imageSize x option$imageSize . It is the simulated binary image with pixel values indiciating gap (i.e., 1's) or non-gaps (i.e., 0's).

LAI

the LAI value used in the simulation. It should be the same as the inputted LAI as specified by option$LAI.

PAR

a copy of the input LAD parameters.

THETA

a vector consisting of 200 zenith angles ranging from 0 to pi/2. It is used to characterize the LAD curve used in simulation.

G

a vector consisting of 200 LAD value evalauted at the zenith agnles of THETA.

References

Zhao et al. (2019). How to better estimate leaf area index and leaf angle distribution from digital hemispherical photography? Switching to a binary nonlinear regression paradigm (under review)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
library(hemiphoto2LAI)

#--------------------------------Example 1--------------------------------#
opt=list()             #Create an empty list to append individual parameters
opt$LAI =3.0           #LAI of the simulated canopy
opt$imageSize=400      #The size of the resulting hemiphoto
opt$scaledParameter=0  #If set to 0, the ladParamter input should be valid values  
                       #falling within the expected range of the chosen LAD. If set
                       # to 1, ladParamter is two numbers within [0, 1] to 
                       # be scaled to the valid ranges of the chosen LAD model.
result=simHemiphoto("es1", c(0.1, NA), opt)
#*****************************End of Example 1****************************#
 

#\donttest
#{
LAI=estimateLAI(result$imageTHETA,result$imageGAP)
#}

zhaokg/hemiphoto2LAI documentation built on July 26, 2019, 9:36 a.m.