Learn R Programming

hsdar (version 0.5.1)

addcp: Add fix point

Description

Add fix point to continuum line.

Usage

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 points.

Value

Object of class Clman containing the updated version of x.

See Also

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

idSpeclib

Examples

Run this code
## 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

Run the code above in your browser using DataLab