get_stem_sweep: Calculate tree sweep from straight line from QMS

View source: R/traits_from_qsm.R

get_stem_sweepR Documentation

Calculate tree sweep from straight line from QMS

Description

This function calculates tree sweep from a QSM. Starting with an idealized vector of a straight tree (straight line from top to bottom QSM segment) the function caclucates devations of points along the trunk from the idealized vector. It resturns sweep from each QSM segment so that summary statistics can be computed by the user. See also 'get_stem_deflection()'

Usage

get_stem_sweep(qsm, terminus_diam_cm = 4, plot = TRUE)

Arguments

qsm

QSM loaded using '[load_qsm()]'.

terminus_diam_cm

numeric – the trunk diameter at which is no longer considered trunk

plot

boolean – indicates whether graph of sweep should be plotted.

Value

A data frame with columns:

Height

Height (m) of each trunk segment midpoint.

sweep

Perpendicular deviation (m) from the idealized straight stem line.

Examples

qsm_file = system.file("extdata", "tree_0744_qsm.txt", package='tReeTraits')
qsm = load_qsm(qsm_file)
print(get_center_of_mass(qsm))
print(get_com_offset(qsm))

tReeTraits documentation built on Feb. 26, 2026, 1:07 a.m.