addcp: Manually add fix point to continuum line

Description Usage Arguments Value Author(s) See Also Examples

View source: R/continuum_clman.R

Description

This function is used to add an additional fix point to a manually created hull of a single spectrum. This fix point is then used to construct a continuum line.

Usage

1
addcp(x, ispec, cpadd) 

Arguments

x

Object of class Clman.

ispec

ID or index of spectrum to be modified.

cpadd

Single value or vector of wavelength containing new fix point(s).

Value

Object of class Clman containing the updated version of x.

Author(s)

Lukas Lehnert and Hanna Meyer

See Also

transformSpeclib, deletecp, getcp, checkhull, makehull, updatecl,

idSpeclib

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## 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, subset = c(2480, 2500))

## 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, subset = c(2480, 2500))

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

hsdar documentation built on Nov. 17, 2017, 4:35 a.m.