Learn R Programming

hsdar (version 0.5.1)

speclib: Methods to create objects of class Speclib

Description

Methods to create objects of class Speclib from various data types

Usage

"speclib"(spectra, wavelength, ...)
"speclib"(spectra, wavelength, ...)
"speclib"(spectra, wavelength, ...)
"speclib"(spectra, wavelength, ...)
"speclib"(spectra, wavelength, ...)
"speclib"(spectra, wavelength, ...)
"speclib"(spectra, wavelength, ...)
"speclib"(spectra, wavelength, ...)
"speclib"(spectra, wavelength, ...)
"speclib"(spectra, wavelength, ...)
"speclib"(spectra, wavelength, ...)
"print"(x)
"show"(object)
createspeclib(spectra, wavelength, fwhm = NULL, attributes = NULL, usagehistory = NULL, transformation = NULL, continuousdata = "auto", wlunit = "nm", xlabel = "Wavelength", ylabel = "Reflectance", rastermeta = NULL)
is.speclib(x)

Arguments

spectra
Data frame, matrix of raster object of class 'RasterBrick' or 'SpatialGridDataFrame' with spectral data
x,object
Object to be converted to or from Speclib. For conversion to Speclib it can be a of class 'data frame', 'matrix', 'list' or 'character string'. In the latter case x is interpreted as path to raster object and read by readGDAL. For conversion from Speclib the object must be of class Speclib.
wavelength
Vector with corresponding wavelength for each band. A matrix or data.frame may be passed giving the upper and lower limit of each band. In this case, the first column is used as lower band limit and the second as upper limit, respectively.
fwhm
Vector containing full-width-half-max values for each band
attributes
Data frame with additional attributes data.
transformation
Kind of transformation applied to spectral data (character)
usagehistory
Character string or vector used for history of usage
continuousdata
Flag indicating if spectra are quasi continuous or discrete sensor spectra
wlunit
Unit of wavelength in spectra
xlabel
Label of wavelength data to be used for plots etc.
ylabel
Label of spectral signal to be used for plots etc.
rastermeta
List of meta information for SpatialGridDataFrame or HyperSpecRaster. If missing, meta data in speclib is used. Use function rastermeta to create valid objects.
...
Further arguments passed to specific (generic) functions or createspeclib

Value

An object of class Speclib containing the following slots is returned:
  • wavelength: Vector with wavelength information
  • fwhm: Vector or single numerical value giving the full-width-half-max value(s) for each band.
  • spectra: Object of class '.Spectra' with three slots:
    • fromRaster: logical, indicating if spectral data is read from a RasterBrick-object.
    • spectra_ma: Matrix with ncol = number of bands and nrow = number. Used if fromRaster == FALSE
    • spectra_ra: RasterBrick-object which is used if fromRaster == TRUE.
    Contains reflectance, transmittance or absorbance values. Handle with function spectra.
  • attributes: Data frame containing additional data to each spectrum. May be used for linear regression etc. Handle with function attribute.
  • usagehistory: Vector giving information on history of usage of speclib. Handle with function usagehistory.
  • rastermeta: List containing meta information to create *Raster objects from Speclib. Handle with function rastermeta.

Details

See details in Speclib.

See Also

Speclib, plot, readGDAL, mask,

idSpeclib, dim, spectra,

attribute

Examples

Run this code
data(spectral_data)
spectra <- spectra(spectral_data)
wavelength <- spectral_data$wavelength

spectra <- speclib(spectra,wavelength)

Run the code above in your browser using DataLab