Movatterモバイル変換


[0]ホーム

URL:


BDAT Implementation in R

christian.vonderach@forst.bwl.de

2020-10-08, 16:43:33

BDAT: a Fortran library for taper curves

BDAT is a Fortran program library to estimate volume,diameter, height, bark thickness and assortments of a specified tree.Hence, it is a library about taper functions. It has been developed atFVA-BW on request of BMELV for the first german national forestinventory (BWI 1, 1987). Adjustements have been made for the BWI2(2002).BDATPro is a version including these latest adjustmentsbut also an additionaly GUI. The latest version includes biomassfunctions and form parameters for NFI3 (=BWI3). Here the latest versionwas implemented.

Colloquially the library is calledBDAT.

The Fortran library has been extensively used in several application,of which the most important might be WEHAM (WaldEntwicklungs- andHolzAufkommensModell: forest developement and timber stock predictionmodel) but also in other forest inventories. At that time, R was notemerged, yet, later direct calls to the Windows-DLL were used. With thepresent R-package, the usage of BDAT in R was highly simplified, portedto other operating systems (32bit and 64bit) and better documented.There are some original documents on my gitlab repository about themethodology and application, but all have been written in German.

The BDAT library is based on a spline representation of the taperfunction of different tree species. A methodological improvement hasbeen made using B-Splines and mixed-modelling, see Kublin et al. 2013and the R-package TapeR. Still, BDAT is in use and keeps being usedsince the library offers more than just the taper form itself:estimation of diameters, height, double bark thickness, volume ofsections defined by height and/or diameter, assortments given parametersand all already parameterised for a whole bunch of tree speciesincluding deciduous tree species with their complex tree crowns. It isbased on approximately 30.000 measured trees and studies on barkthickness and tree crown volume.

further references

Further references like BDAT Documentations, related articles andreports can be found athttps://gitlab.com/vochr/rbdat especially athttps://gitlab.com/vochr/rbdat/-/tree/master/bdatdocs,unfortunately these resources are all written in German.

Functions

The R-package contains all relevant functions from theFortran-library and uses vectorized evaluation. It is recommended to usethe get*-functions, but for convenience wrapper functions using thenames of the Fortan-subroutines are included so that older scripts caneasily be adapted to the use of the R-package.

Beside the core-functions (buildTree, getDiameter, getHeight,getVolume, getAssortment, getBiomass, getBark, getForm andgetSpeciesCode) there is a plotting function.

preliminary note

The use of the BDAT Fortran functions requires the preparation of thedata to conform with what Fortran is expecting to come. Within thisR-Package, this is implemented in two ways: either one can prepare allnecessary variables within a list or data frame and pass it over to therespective function via thetree parameter or one can passa tree definition into parametertree of each function anduse the second parameter (i.e. Dx,Hx,AB orsort, here calledvars) tohand over the required - function specific - information. In the firstcase, the function returns one result for each row given. In the secondcase, a cross join / cartesian product betweentree andvars is calculated. Ifvars is of size one,the results is the same as in the first case. If the size ofvars is bigger than one, the functions return one value foreach given tree (e.g. 3) and element ofvars (e.g. 4), inthe example this is 12. For functions returning a scalar, a matrix isreturned withtrees given in rows andvarsgiven in columns (e.g. 3x4-matrix). The assortment function, usuallyreturning a data frame, still returns a data frame, but now the order(and naming) of trees is different from the given inputtree parameter, since internally the tree object is nowexpanded. Hence, the first tree is repeated (length-of-vars) number oftimes, before the second tree is process and returned and so on.

Getting started

In BDAT, a tree is specified at its minimum by its species code, dbh(diameter in breast height, i.e. 1.3m) and height. Implicitly, thisdefines a second diameter in 30% of three height according to the“Masse-Tafeln” (Volume-Tables) from Grundner und Schwappach (1921). Forthe possibility of more precisely specifying taper form see furtherbelow.

library(rBDAT)
## This is rBDAT 1.1.0
tree<-buildTree(tree =list(spp=1,D1=30,H=27))str(tree)
## Classes 'datBDAT' and 'data.frame':  1 obs. of  6 variables:##  $ spp: num 1##  $ D1 : num 30##  $ H  : num 27##  $ H1 : num 1.3##  $ D2 : num 0##  $ H2 : num 0

One can visualise the taper curve of a given tree using theplot-function:

plot(tree)

Here, the taper curve over bark (black) and under bark (grey) isdrawn.

getting BDAT-species code

BDAT has been parameterised for 36 tree species, more or less commonin Germany based on about 30.000 trees. These 36 tree species are indexand each posesses its own BDAT-species code. This code and therespective species name (short and long format), english species nameand scientific name can be retrieved by the getSpeciesCode-function:

getSpeciesCode()
##    ID kurz            lang short                   long            scientific## 1   1   Fi          Fichte    NS        European spruce           Picea abies## 2   2   SF    Sitka-Fichte    SS           Sitka spruce      Picea sitchensis## 3   3   Ta           Tanne   ESF    European silver fir            Abies alba## 4   4   KT    Kuestentanne    GF              Grand fir         Abies grandis## 5   5  Kie          Kiefer    SP            Common pine      Pinus sylvestris## 6   6   SK   Schwarzkiefer   AUP    European black pine           Pinus nigra## 7   7   WK Weymouthskiefer   WEP          Weymouth pine         Pinus strobus## 8   8   DG       Douglasie    DF            Douglas fir Pseudotsuga menziesii## 9   9   La         Laerche   XLA                  larch            Larix spp.## 10 10   EL  Europ. Laerche   ELA         European larch         Larix decidua## 11 11   JL    Jap. Laerche   JLA         Japanese larch       Larix kaempferi## 12 12   Th           Thuja    RC            Arbor vitae         Thuja plicata## 13 13   Ts           Tsuga    WH         Canada hemlock    Tsuga heterophylla## 14 14   SN             sNB    XC         other conifers     Coniferales trees## 15 15   Bu           Buche    BE           Common beech       Fagus sylvatica## 16 16   HB       Hainbuche   HBM               hornbeam      Carpinus betulus## 17 17   Ei           Eiche    OK Common oak/sessile oak          Quercus spp.## 18 18   RE        Roteiche   ROK                Red oak         Quercus rubra## 19 19   Pa          Pappel   XPO                 poplar          Populus spp.## 20 20   BP    Balsampappel   BPO          Balsam poplar   Populus balsamifera## 21 21   Es           Esche    AH             Common ash    Fraxinus excelsior## 22 22   Ah           Ahorn   XAH                  maple             Acer spp.## 23 23   BA       Bergahorn    SY         sycamore maple   Acer pseudoplatanus## 24 24   SA      Spitzahorn   NOM            plane maple      Acer platanoides## 25 25   FA       Feldahorn    FM            field maple        Acer campestre## 26 26   Bi           Birke   XBI                  birch           Betula spp.## 27 27   Li           Linde    LI              lime tree            Tilia spp.## 28 28   Er            Erle    AR                  alder            Alnus spp.## 29 29  Kir         Kirsche   WCH                 cherry          Prunus avium## 30 30   Ul            Ulme    EM                    elm            Ulmus spp.## 31 31   Ro         Robinie    BL         Common robinia  Robinia pseudoacacia## 32 32   El        Elsbeere   WST      Wild service tree     Sorbus torminalis## 33 33   Ka        Kastanie    SC      European chestnut       Castanea sativa## 34 34   We           Weide   XWL                 willow            Salix spp.## 35 35   LB             sLB    XB      other broadleaves   Magnoliopsida trees## 36 36   VB      Vogelbeere   ROW            rowan berry      Sorbus aucuparia

If the function is called without any parameter, a data.frame isreturned holding the information which can be retrieved. One canalternatively specify the type ofinput andoutput.Input must be one of the data entries,output must be one of the column names.

getSpeciesCode(1)
##   ID kurz   lang short            long  scientific## 1  1   Fi Fichte    NS European spruce Picea abies
getSpeciesCode("Fi")
## [1] 1
getSpeciesCode("NS")# english abbreviation of Norway spruce
## [1] 1
getSpeciesCode(1,"scientific")
## [1] "Picea abies"
getSpeciesCode(c(1:36),"short")
##  [1] "NS"  "SS"  "ESF" "GF"  "SP"  "AUP" "WEP" "DF"  "XLA" "ELA" "JLA" "RC" ## [13] "WH"  "XC"  "BE"  "HBM" "OK"  "ROK" "XPO" "BPO" "AH"  "XAH" "SY"  "NOM"## [25] "FM"  "XBI" "LI"  "AR"  "WCH" "EM"  "BL"  "WST" "SC"  "XWL" "XB"  "ROW"

getting diameter in given height

The taper functions specify a curve being a function of height withintree and returns the respective diameter. Hence, one can evalutate thisfunction at a given height and receive the diameter. There are fortranfunctions to return either diameter over bark and diameter under bark,but this package binds these functions together and uses a booleanparameter to switch between both.

getDiameter(tree,Hx =1.3)# return dbh
## [1] 30

As a default, diameter over bark is returned, but this can easily bechanged:

getDiameter(tree,Hx =1.3,bark =FALSE)# return d.u.b. at 1.3m
## [1] 28.40971

It is possible to request diameter in several heights at once:

getDiameter(tree,Hx =c(1:10))
##  [1] 31.14922 28.44761 27.57622 26.92106 26.32229 25.76090 25.21790 24.67427##  [9] 24.11234 23.52139

Using this kind of call to the functions,Hx isevaluated for each given tree separately:

tree2<-buildTree(list(spp=1,D1=c(30,35),H=27))getDiameter(tree2,Hx =c(1,2))
##          [,1]     [,2]## [1,] 31.14922 28.44761## [2,] 36.54927 32.92451

Here, a matrix is returned with one row per tree and one column perrequested Hx.

An alternative way is specifyingHx directly inside thetree-object:

tree2<-buildTree(list(spp=1,D1=c(30,35),H=27,Hx=c(1,2)))tree2
##   spp D1  H Hx  H1 D2 H2## 1   1 30 27  1 1.3  0  0## 2   1 35 27  2 1.3  0  0
getDiameter(tree2)
## [1] 31.14922 32.92451

Here, tree2 consists of 2 rows, because the give list is internallytransformed into a data frame (common rules for building data.framesapply). Finally, the object is evaluated row-wise. BecauseHx is already given, the parameterHx can beleft empty.

getting double bark thickness

Double bark thickness is that part of a diameter over bark, which isconsidered to consist of bark tissue. The relation between wood and barkwith respect to diameter can be expressed as {double bark thickness} +{diameter under bark} = {diameter over bark}. The implemented functionsoriginate from the works of Altherr et al. (1974, 1975, 1976, 1978 and1979).

dub<-getDiameter(tree,Hx=1.3,bark =FALSE)dob<-getDiameter(tree,Hx=1.3,bark =TRUE)dbt<-getBark(tree,Hx=1.3)dub+ dbt== dob
## [1] TRUE

Again, it is possible to either include parameterHxinto the tree-object or pass it separately. In the second case, anmatrix is returned if Hx is longer than one.

getBark(tree2,Hx =1:5)
##          [,1]     [,2]     [,3]     [,4]     [,5]## [1,] 1.636124 1.527308 1.491416 1.464177 1.439089## [2,] 1.842470 1.705602 1.661812 1.629562 1.600471

getting height for given diameter

The diameter-height-relation from above, where we evaluated thefunction for a given height-value, can also be evaluated for a givendiameter. The internal function is an iterative procedure to determineheight. Diameter can be specified over and under bark. Default is bark =TRUE.

getHeight(tree,Dx=30)# height of diameter over bark
## [1] 1.3
getHeight(tree,Dx=30,bark =FALSE)# height of diameter under bark == 30
## [1] 0.8916153

Again, it is possible to vary passing of theDx-parameter: it can take one or several values, but canalso be included to the tree parameter. In the first case, a cross join/ cartesian product betweentree andDx iscreated, in the second case thetree object is processedas is.

getHeight(tree2,Dx=c(30,20,10))# returns value in meters
##          [,1]     [,2]     [,3]## [1,] 1.300000 14.82080 22.65465## [2,] 5.370549 17.27376 23.05898
tree2$Dx=c(30,20)getHeight(tree2)
## [1]  1.30000 17.27376

As one can see, in the first case a matrix with one row per tree andone column perDx is returned and in the second call, avector with one element for each row intree2.

getting volume

The maybe most interesting function is the one returning volume. Thefunction includes a switch to return volume with (the default) orwithout bark volume as well. Volume is calculated usingmiddiameter-formula (in Germany called “Huber’sche Formel”) from2m-sections (default), but section lengths can be varied. Additionally,it is necessary to specify the section for which volume is required.This can be done either using diameters or heights, or a mixture ofboth. If parameterAB is not given, i.e. NULL, then thefunction assumes coarse wood volume over bark is required (i.e. fromforest floor up to diameter over bark of 7cm):

getVolume(tree)# get coarse wood, which is the same as next line
## [1] 0.9168622
getVolume(tree,AB =list(A=0,B=7),iAB=c("H","Dob"),bark = T)
## [1] 0.9168622

One can precisely specify the section for which volume under or overbark is required:

# volume including bark between height 1m and 2mgetVolume(tree2,AB=list(A=1,B=2))
## [1] 0.06184182 0.08197092
# volume excluding bark between 30 and 7cm in diameter over barkgetVolume(tree2,AB=list(A=30,B=7),iAB="dob",bark = F)
## [1] 0.7153726 0.6583801

The section length for which middiameter-formula is applied is 2m asa default. It is possible to change that behaviour by setting parametersl inside theAB-argument:

# again: coarse wood volumegetVolume(tree)
## [1] 0.9168622
# identicalgetVolume(tree,AB=list(A=0.27,B=7,sl=2),iAB=c("H","Dob"),bark=F)
## [1] 0.7892534
# using sl=0.1, that is section length for volume calculation set to be 0.1mgetVolume(tree,AB=list(A=0.27,B=7,sl=0.1),iAB=c("H","Dob"),bark=F)
## [1] 0.7971188

If one wants to get the volume for several sections of a tree, onecould either build a suited data.frame on its own, repeating the treeattributes and adjusting theAandB values asneeded. The more elegant way is to let the functions do that work foryou. In the easiest case, we saw that already in the example above,specifying one tree and one section, where the function returns exactlyone volume. Internally, theAB data is merged to the treedata by a cross join (or cartesion product), hence we can make use ofthat behaviour by defining several sections at once:

getVolume(tree,AB=list(A=0:9,B=1:10))
##  [1] 0.09056835 0.06184182 0.06128590 0.05816483 0.05563769 0.05319688##  [7] 0.05102357 0.04886994 0.04674566 0.04458112
getVolume(tree = tree2,AB=list(A=0:9,B=1:10))
##            [,1]       [,2]       [,3]       [,4]       [,5]       [,6]## [1,] 0.09056835 0.06184182 0.06128590 0.05816483 0.05563769 0.05319688## [2,] 0.12786366 0.08197092 0.08171326 0.07714033 0.07358742 0.07018656##            [,7]       [,8]       [,9]      [,10]## [1,] 0.05102357 0.04886994 0.04674566 0.04458112## [2,] 0.06725162 0.06435400 0.06151795 0.05862010

getting biomass

Beside getting volume section information, there is a function to gettotal aboveground biomass. These biomass-functions were fittedindependently of the parameterisation of BDAT and were developed inpreparation of the german NFI3. These functions are based on 983analysed trees of a subset of species only. The other species are eitherfit at a synthetical data set or in worst case subsumed to otherspecies. These functions are the official ones used during reporting ofresults of the NFI3.

The call is identical to the already shown pattern:

getBiomass(tree)
## [1] 406.1523
getBiomass(list(spp=1,D1=30,H=27,D2=c(23,24,25)))
## [1] 350.5038 375.2445 400.5624

getting assortments

One very nice feature of the BDAT program library is its ability touse the presented functions to simulate roundwoods from given trees. Forthat purpose a separate function was written, which is called viagetAssortment(). Similarly to other functions, it requiresdata of one or more trees and optionally parameters to control thesorting process. There are quite a few parameters to be specified. It’seasiest to show that using some examples:

getAssortment(tree2)# using standard assortment parameters
##    tree No Sort height    length      midD      topD        Vol## 1     1  1    X   0.00  0.000000  0.000000  0.000000 0.00000000## 2     1  2  Sth   0.27 20.000000 21.250875 12.429831 0.70937115## 3     1  3   Ab   0.00  0.000000  0.000000  0.000000 0.00000000## 4     1  4  Ind  20.47  1.000000 11.460602 10.725959 0.01031584## 5     1  5 nvDh  21.47  2.717499  8.529173  5.998856 0.01552648## 6     2  1    X   0.00  0.000000  0.000000  0.000000 0.00000000## 7     2  2  Sth   0.27 20.000000 24.499969 13.956373 0.94286811## 8     2  3   Ab   0.00  0.000000  0.000000  0.000000 0.00000000## 9     2  4  Ind  20.47  1.000000 12.778620 11.893189 0.01282501## 10    2  5 nvDh  21.47  2.904999  9.106683  5.990857 0.01892153

By default, a data.frame is returned with one row for each tree androundwood piece. It keeps information about the roundwood foot positioninside the stem, its length (without add-on), mid-diameter under bark(midD), top-diameter under bark (topD) and the respective volume underbark. The standard assortments comprise stem-wood (Sth), second lengthstem wood (Ab, after optionally specified cutting diameter for Sth orafter transportation-cut, i.e. 20m), industrial roundwood (Ind) andresidual coarse wood (nvDh, between cutting diameter for Ind and 7cmover bark). Assortment X is unusuable wood at the stem foot.

If one is interested in raw BDAT return, one can specifyvalue='raw':

getAssortment(tree2,value ="raw")# usually of little interest...
## $n## [1] 2## ## $BDATArtNr## [1] 1 1## ## $D1## [1] 30 35## attr(,"Csingle")## [1] TRUE## ## $H1## [1] 1.3 1.3## attr(,"Csingle")## [1] TRUE## ## $D2## [1] 0 0## attr(,"Csingle")## [1] TRUE## ## $H2## [1] 0 0## attr(,"Csingle")## [1] TRUE## ## $H## [1] 27 27## attr(,"Csingle")## [1] TRUE## ## $lX## [1] 0 0## attr(,"Csingle")## [1] TRUE## ## $Hkz## [1] 0 0## ## $Skz## [1] 0 0## ## $Az## [1] 0 0## attr(,"Csingle")## [1] TRUE## ## $Hsh## [1] 0 0## attr(,"Csingle")## [1] TRUE## ## $Zsh## [1] 0 0## attr(,"Csingle")## [1] TRUE## ## $Zab## [1] 0 0## attr(,"Csingle")## [1] TRUE## ## $Sokz## [1] 1 1## ## $Skl##  [1] 0 0 2 0 0 0 0 0 2 0 0 0## ## $Vol##  [1] 0.91686225 0.00000000 0.70937115 0.00000000 0.01031584 0.01552648##  [7] 0.18164879 1.21056700 0.00000000 0.94286811 0.00000000 0.01282501## [13] 0.01892153 0.23595232## attr(,"Csingle")## [1] TRUE## ## $LDSort##  [1]  0.000000  0.000000  0.000000  0.000000  0.270000 20.000000 21.250875##  [8] 12.429831  0.000000  0.000000  0.000000  0.000000 20.470001  1.000000## [15] 11.460602 10.725959 21.470001  2.717499  8.529173  5.998856  0.000000## [22]  0.000000  0.000000  0.000000  0.270000 20.000000 24.499969 13.956373## [29]  0.000000  0.000000  0.000000  0.000000 20.470001  1.000000 12.778620## [36] 11.893189 21.470001  2.904999  9.106683  5.990857## attr(,"Csingle")## [1] TRUE## ## $BHD## [1] 30 35## attr(,"Csingle")## [1] TRUE## ## $Ifeh## [1] 0 0## ## $FixLngDef## [1] 0 0 0 0 0 0 0 0## attr(,"Csingle")## [1] TRUE## ## $NMaxFixLng## [1] 0 0## ## $FixLng##   [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0##  [38] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0##  [75] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0## [112] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0## [149] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0## [186] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0## [223] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0## [260] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0## [297] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0## [334] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0## attr(,"Csingle")## [1] TRUE## ## $NFixLng## [1] 0 0

Other options are also available like ‘Vol’ (Volume), ‘Skl’(Stärkeklassen, i.e. diameter classes), ‘Fix’ (fixed length assortments,if specified) and ‘LDSort’ (an added feature w.r.t. the original BDATFortran code, keeping length and diameter of the assortments, which wasmissing in the original BDAT library, hence only available in rBDAT!),which return a subset of the raw BDAT return value. The default is‘merge’ which produces an aggregated data.frame of relevant informationabout the roundwoods produced for each tree.

As said before, assortment rules can be specified using severalparameters, which in detail are given in the help file. Some examplesfollow:

getAssortment(tree,sort=list(Az=15))# minimum diameter o.b. for assortments
##   tree No Sort height    length     midD      topD        Vol## 1    1  1    X  0.000  0.000000  0.00000  0.000000 0.00000000## 2    1  2  Sth  0.270 19.100000 21.51180 13.584801 0.69418710## 3    1  3   Ab  0.000  0.000000  0.00000  0.000000 0.00000000## 4    1  4  Ind  0.000  0.000000  0.00000  0.000000 0.00000000## 5    1  5 nvDh 19.561  4.626499 10.10419  5.998856 0.03709757
getAssortment(tree,sort=list(Az=15,Hsh=10))# Hsh= max. height of sawlog quality
## Warning in getAssortment.datBDAT(tree, sort = list(Az = 15, Hsh = 10)): error indication in subroutine BDAT20:## tree 1: Top-shafted coniferous tree with positive stem height: Skz = 0|1 and Hsh > 0; spp < 15
##   tree No Sort height length midD topD Vol## 1    1  1    X     NA     NA   NA   NA  NA## 2    1  2  Sth     NA     NA   NA   NA  NA## 3    1  3   Ab     NA     NA   NA   NA  NA## 4    1  4  Ind     NA     NA   NA   NA  NA## 5    1  5 nvDh     NA     NA   NA   NA  NA

Additionally one can specify a fixed length assortment at stem foot,which is cut before sawlogs.

## fixN = number of roundwood pieces## fixL = length of roundwood pieces in m## fixA = absolute length addition (good for measure) in cm## fixR = relative length addition in %## fixZ = minimum cutting diameter for this assortment (Z=Zopf) in cmgetAssortment(tree,sort=list(Az=15,fixN=2,fixL=4,fixA=10,fixZ=20))
##   tree No  Sort height  length     midD     topD       Vol## 1    1  1     X  0.270  8.2000 24.48928 22.25621 0.0000000## 2    1  2   Sth 16.670 10.9000 19.04127  0.00000 0.3103904## 3    1  3    Ab  0.000  0.0000  0.00000  0.00000 0.0000000## 4    1  4   Ind  0.000  0.0000  0.00000  0.00000 0.0000000## 5    1  5  nvDh 27.679  4.7085 10.16843  0.00000 0.0382367## 6    1  6 Fix01  0.270  4.0000 25.86922 24.54741 0.2102405## 7    1  7 Fix02  4.370  4.0000 23.40202 22.30943 0.1720507

In case the considered tree exhibits rotten/decaying wood at stemfoot, this can also be specified (in german termed X-Holz):

getAssortment(tree,sort=list(lX=1.4))# remove 1.4m from stump upwards
##   tree No Sort height    length      midD      topD        Vol## 1    1  1    X   0.27  1.400000 28.892862 26.715826 0.09179077## 2    1  2  Sth   1.67 20.000000 20.387375 10.421552 0.65289372## 3    1  3   Ab   0.00  0.000000  0.000000  0.000000 0.00000000## 4    1  4  Ind   0.00  0.000000  0.000000  0.000000 0.00000000## 5    1  5 nvDh  21.87  2.317499  8.178885  5.998856 0.01217580

Additionally, one can plot the taper curve and include theassortments:

assort<-getAssortment(tree,sort=list(Az=15,fixN=2,fixL=4,fixA=10,fixZ=20))plot(tree,assort=assort)

using more than one assortment specification

buildTree uses the parameterstree andvars which are merged by a cross join / cartesian product.Hence, if assortment specifications are extended to a length bigger one,the function should return an estimated assortment for each tree andspecified assortment. Let’s check that:

getAssortment(tree,sort =list(Az=c(10,7)))
##    tree No Sort height     length      midD      topD         Vol## 1     1  1    X   0.00  0.0000000  0.000000  0.000000 0.000000000## 2     1  2  Sth   0.27 20.0000000 21.250875 12.429831 0.709371150## 3     1  3   Ab   0.00  0.0000000  0.000000  0.000000 0.000000000## 4     1  4  Ind  20.47  2.0000000 10.725959  9.139494 0.018071413## 5     1  5 nvDh  22.47  1.7174988  7.639552  5.998856 0.007872671## 6     2  1    X   0.00  0.0000000  0.000000  0.000000 0.000000000## 7     2  2  Sth   0.27 20.0000000 21.250875 12.429831 0.709371150## 8     2  3   Ab   0.00  0.0000000  0.000000  0.000000 0.000000000## 9     2  4  Ind  20.47  3.0000000  9.953113  7.379699 0.023341509## 10    2  5 nvDh  23.47  0.7174988  6.702212  5.998856 0.002531322
getAssortment(tree2,sort =list(Az=c(10,7)))
##    tree No Sort height     length      midD      topD         Vol## 1     1  1    X   0.00  0.0000000  0.000000  0.000000 0.000000000## 2     1  2  Sth   0.27 20.0000000 21.250875 12.429831 0.709371150## 3     1  3   Ab   0.00  0.0000000  0.000000  0.000000 0.000000000## 4     1  4  Ind  20.47  2.0000000 10.725959  9.139494 0.018071413## 5     1  5 nvDh  22.47  1.7174988  7.639552  5.998856 0.007872671## 6     2  1    X   0.00  0.0000000  0.000000  0.000000 0.000000000## 7     2  2  Sth   0.27 20.0000000 24.499969 13.956373 0.942868114## 8     2  3   Ab   0.00  0.0000000  0.000000  0.000000 0.000000000## 9     2  4  Ind  20.47  2.0000000 11.893189 10.009459 0.022218592## 10    2  5 nvDh  22.47  1.9049988  8.071947  5.990857 0.009748576## 11    3  1    X   0.00  0.0000000  0.000000  0.000000 0.000000000## 12    3  2  Sth   0.27 20.0000000 21.250875 12.429831 0.709371150## 13    3  3   Ab   0.00  0.0000000  0.000000  0.000000 0.000000000## 14    3  4  Ind  20.47  3.0000000  9.953113  7.379699 0.023341509## 15    3  5 nvDh  23.47  0.7174988  6.702212  5.998856 0.002531322## 16    4  1    X   0.00  0.0000000  0.000000  0.000000 0.000000000## 17    4  2  Sth   0.27 20.0000000 24.499969 13.956373 0.942868114## 18    4  3   Ab   0.00  0.0000000  0.000000  0.000000 0.000000000## 19    4  4  Ind  20.47  3.0000000 10.970320  7.971595 0.028356308## 20    4  5 nvDh  23.47  0.9049988  6.997648  5.990857 0.003480503

Here, the first call returns the estimated assortments for bothassortment specifications, the tree order inside the resulting object isclear: tree 1 uses Az=10 and tree 2 uses Az=7. In the second call, theorder is the same, although this is not as clear as in the firstexample.

more advanced specification of trees

As shown, a tree is specified by its species code, its dbh andheight. If done so, this assumes a predefined diameter in 30% of treeheight, which in turn defines the taper form or the relation betweendiameter in 30% and 5% of the tree height. But easily, this can bechanged: the BWI-equivalent taper form can be specified using H2=50. TheD2 and H2 parameter can take a very flexible parameterisation beingdiameter and heights but also quantiles of the q03-distribution (H2) orthe q03-parameter itself (D2). q03 is the quotient of diameter in 30% ofthree height and in 5% of tree height. Hence, quite a variety of taperforms can be represented. All BDAT-functions respond sensitively to thisfourth parameter.

tree<-buildTree(tree =list(spp=1,D1=30,H=27,H2=c(30,50,99,0),D2=c(0,0,0,-0.8),Hx=0.3*27))str(tree)
## Classes 'datBDAT' and 'data.frame':  4 obs. of  7 variables:##  $ spp: num  1 1 1 1##  $ D1 : num  30 30 30 30##  $ H  : num  27 27 27 27##  $ H2 : num  30 50 99 0##  $ D2 : num  0 0 0 -0.8##  $ Hx : num  8.1 8.1 8.1 8.1##  $ H1 : num  1.3 1.3 1.3 1.3
getDiameter(tree)# Hx specified beforehand being 30% of tree height
## [1] 23.19664 24.00090 27.59044 23.84774

With the getForm-function, one can specify trees mimicking the meansample trees from different inventories. This function returns theexpected q03 of a given diameter-height-class, here of dbh=30 andh=27:

getForm(tree[1,],inv=c(1,2,3,4))
## [1] 0.8049681 0.7996023 0.7913954 0.8107125

[8]ページ先頭

©2009-2025 Movatter.jp