Learn R Programming

hsdar (version 0.5.1)

deletecp: Delete fix point

Description

Delete fix point from continuum line.

Usage

deletecp(x, ispec, cpdelete)

Arguments

x
Object of class Clman.
ispec
ID or index of spectrum to be modified.
cpdelete
Single value or vector of wavelength containing fix point(s) to be deleted.

Value

Object of class Clman containing the updated version of x.

See Also

transformSpeclib, addcp, getcp, checkhull, makehull, updatecl

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)
## Mask parts not necessary for the example
mask(spec) <- c(1600, 2600)

## 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(1100, 1300))

## Find wavelength of fix point to be deleted
getcp(spec_clman, 1, subset = c(1100, 1300))

## Delete all fix points between 1200 and 1240 nm
spec_clman <- deletecp(spec_clman, 1, c(1200:1240))

## Plot new line
plot(spec_clman, ispec = 1, subset = c(1100, 1300))

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

Run the code above in your browser using DataLab