updatecl: Check transformed Speclib

updateclR Documentation

Check transformed Speclib

Description

Update a transformed Speclib with a re-calculated hull

Usage

updatecl(x, hull) 

Arguments

x

Object of class Speclib transformed by transformSpeclib.

hull

Hull to be applied to x. Output of function makehull.

Details

In some cases, it might be desirable to manually adapt automatically constructed segmended hulls (transformSpeclib). For example local maxima could be removed because they are very small and maybe afflicted with uncertainties which might legitimate it to manipulate the continuum line. Therefore, hsdar provides functions to remove and add "continuum points" from or to a continuum line. Manually adapted continuum lines can then be used to update band depth or ratio transformation. Handle these functions with care to avoid continuum lines too much build by subjective decisions. In the typical workflow, spectra are first transformed (transformSpeclib). Continuum points can then be retrieved (getcp) and manually adapted by adding addcp and deleting (deletecp) of points. Use checkhull to check for errors. If all uncertainties are removed, re-calculate the hull (makehull) and update the transformed spectrum (updatecl).

Value

Object of class Speclib.

Author(s)

Lukas Lehnert and Hanna Meyer

See Also

transformSpeclib, makehull, Speclib

Examples

## Model spectra using PROSAIL
parameter <- data.frame(N = rep.int(c(1, 1.5),2), LAI = c(1,1,3,3))
spec <- PROSAIL(parameterList=parameter)

## Transform spectra
spec_clman <- transformSpeclib(spec, method = "sh", out = "raw")

## Plot original line
par(mfrow = c(1,2))
plot(spec_clman, ispec = 1, xlim = c(2480, 2500), ylim=c(0.022,0.024))

## Add fix point at 4595 nm to continuum line of first spectrum
spec_clman <- addcp(spec_clman, 1, 2495)

## Plot new line
plot(spec_clman, ispec = 1, xlim = c(2480, 2500), ylim=c(0.022,0.024))

## Check new hull
hull <- checkhull(spec_clman, 1)
hull$error

## Add fix point at 4596 nm to continuum line of first spectrum
spec_clman <- addcp(spec_clman, 1, 2496)

## Check new hull
hull <- checkhull(spec_clman, 1)
hull$error

## Re-calculate hull
hull <- makehull(spec_clman, 1)

## Transform spectra using band depth
spec_bd <- transformSpeclib(spec, method = "sh", out = "bd")

## Update continuum line of first spectrum
spec_bd <- updatecl(spec_bd, hull)

## Plot modified transformed spectrum
plot(spec_bd, FUN = 1)

hsdar documentation built on March 18, 2022, 6:35 p.m.