chop: chop spectra into low and high parts

View source: R/colorSpec.ops.R

chopR Documentation

chop spectra into low and high parts

Description

chop all spectra in a colorSpec object into low and high parts at a blending interval

Usage

## S3 method for class 'colorSpec'
chop( x, interval, adj=0.5 )

Arguments

x

a colorSpec object

interval

a numeric vector with length 2 giving the endpoints of the interval, in nm

adj

a number in [0,1] defining weights of low and high parts over the interval

Details

For each spectrum, the low and high parts sum to the original spectrum. The low part vanishes on the right of the interval, and the high part vanishes on the left.

Value

chop(x) returns a colorSpec object with twice the number of spectra in x and with organization equal to 'matrix'. The names of the new spectra are formed by appending ".lo" and ".hi" to the original spectrum names.

See Also

organization,

Examples

# chop blue butane flame into diatomic carbon and hydrocarbon parts
path = system.file( "extdata/sources/BlueFlame.txt", package="colorSpec" )
blueflame = readSpectra( path, seq(375,650,0.5) )
plot( chop( blueflame, interval=c(432,435), adj=0.8 ) )

# chop 'white' LED into blue and yellow parts
path = system.file( "extdata/sources/Gepe-G-2001-LED.sp", package="colorSpec" )
LED = readSpectra( path )
plot( chop( LED, c(470,495) ) )

colorSpec documentation built on May 29, 2024, 6 a.m.