Skip to contents

Build a list of unweighted "waveband" objects that can be used as input when calculating irradiances.

Usage

split_bands(
  x,
  list.names = NULL,
  short.names = is.null(list.names),
  length.out = NULL
)

Arguments

x

a numeric vector of wavelengths to split at (nm), or a range of wavelengths or a generic_spct or a waveband.

list.names

character vector with names for the component wavebands in the returned list (in order of increasing wavelength)

short.names

logical indicating whether to use short or long names for wavebands

length.out

numeric giving the number of regions to split the range into (ignored if w.length is not numeric).

Value

an un-named list of waveband objects

Note

list.names is used to assign names to the elements of the list, while the waveband objects themselves always retain their wb.label and wb.name as generated during their creation.

See also

Other waveband constructors: waveband()

Examples

split_bands(c(400,500,600))
#> $wb1
#> range.400.500 
#> low (nm) 400 
#> high (nm) 500 
#> weighted none 
#> 
#> $wb2
#> range.500.600 
#> low (nm) 500 
#> high (nm) 600 
#> weighted none 
#> 
split_bands(list(c(400,500),c(550,650)))
#> $wb.a
#> range.400.500 
#> low (nm) 400 
#> high (nm) 500 
#> weighted none 
#> 
#> $wb.b
#> range.550.650 
#> low (nm) 550 
#> high (nm) 650 
#> weighted none 
#> 
split_bands(list(A=c(400,500),B=c(550,650)))
#> $A
#> range.400.500 
#> low (nm) 400 
#> high (nm) 500 
#> weighted none 
#> 
#> $B
#> range.550.650 
#> low (nm) 550 
#> high (nm) 650 
#> weighted none 
#> 
split_bands(c(400,500,600), short.names=FALSE)
#> $range.400.500
#> range.400.500 
#> low (nm) 400 
#> high (nm) 500 
#> weighted none 
#> 
#> $range.500.600
#> range.500.600 
#> low (nm) 500 
#> high (nm) 600 
#> weighted none 
#> 
split_bands(c(400,500,600), list.names=c("a","b"))
#> $a
#> range.400.500 
#> low (nm) 400 
#> high (nm) 500 
#> weighted none 
#> 
#> $b
#> range.500.600 
#> low (nm) 500 
#> high (nm) 600 
#> weighted none 
#> 
split_bands(c(400,700), length.out=6)
#> $wb1
#> range.400.450 
#> low (nm) 400 
#> high (nm) 450 
#> weighted none 
#> 
#> $wb2
#> range.450.500 
#> low (nm) 450 
#> high (nm) 500 
#> weighted none 
#> 
#> $wb3
#> range.500.550 
#> low (nm) 500 
#> high (nm) 550 
#> weighted none 
#> 
#> $wb4
#> range.550.600 
#> low (nm) 550 
#> high (nm) 600 
#> weighted none 
#> 
#> $wb5
#> range.600.650 
#> low (nm) 600 
#> high (nm) 650 
#> weighted none 
#> 
#> $wb6
#> range.650.700 
#> low (nm) 650 
#> high (nm) 700 
#> weighted none 
#> 
split_bands(400:700, length.out=3)
#> $wb1
#> range.400.500 
#> low (nm) 400 
#> high (nm) 500 
#> weighted none 
#> 
#> $wb2
#> range.500.600 
#> low (nm) 500 
#> high (nm) 600 
#> weighted none 
#> 
#> $wb3
#> range.600.700 
#> low (nm) 600 
#> high (nm) 700 
#> weighted none 
#> 
split_bands(sun.spct, length.out=10)
#> $wb1
#> range.280.332 
#> low (nm) 280 
#> high (nm) 332 
#> weighted none 
#> 
#> $wb2
#> range.332.384 
#> low (nm) 332 
#> high (nm) 384 
#> weighted none 
#> 
#> $wb3
#> range.384.436 
#> low (nm) 384 
#> high (nm) 436 
#> weighted none 
#> 
#> $wb4
#> range.436.488 
#> low (nm) 436 
#> high (nm) 488 
#> weighted none 
#> 
#> $wb5
#> range.488.540 
#> low (nm) 488 
#> high (nm) 540 
#> weighted none 
#> 
#> $wb6
#> range.540.592 
#> low (nm) 540 
#> high (nm) 592 
#> weighted none 
#> 
#> $wb7
#> range.592.644 
#> low (nm) 592 
#> high (nm) 644 
#> weighted none 
#> 
#> $wb8
#> range.644.696 
#> low (nm) 644 
#> high (nm) 696 
#> weighted none 
#> 
#> $wb9
#> range.696.748 
#> low (nm) 696 
#> high (nm) 748 
#> weighted none 
#> 
#> $wb10
#> range.748.800 
#> low (nm) 748 
#> high (nm) 800 
#> weighted none 
#> 
split_bands(waveband(c(400,700)), length.out=5)
#> $wb1
#> range.400.460 
#> low (nm) 400 
#> high (nm) 460 
#> weighted none 
#> 
#> $wb2
#> range.460.520 
#> low (nm) 460 
#> high (nm) 520 
#> weighted none 
#> 
#> $wb3
#> range.520.580 
#> low (nm) 520 
#> high (nm) 580 
#> weighted none 
#> 
#> $wb4
#> range.580.640 
#> low (nm) 580 
#> high (nm) 640 
#> weighted none 
#> 
#> $wb5
#> range.640.700 
#> low (nm) 640 
#> high (nm) 700 
#> weighted none 
#>