get_spectra: Reads ASD files

Description Usage Arguments Value Author(s) Examples

Description

Reads either the reflectance, raw DN, or white reference data stored in one or more ASD files.

Usage

1
get_spectra(f, type = "reflectance")

Arguments

f

a vector of paths to ASD file(s)

type

a character vector, which type of spectra to return. "reflectance", "raw", "white_reference" are currently supported

Value

a matrix of the spectrum contained in the ASD file(s)

Author(s)

Pierre Roudier

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# Get the path to the demo file

asd_fn <- asd_file()
print(asd_fn)

# Example with one file name

m1 <- get_spectra(asd_fn)
matplot(t(m1), type = 'l')

# Example with a vector of file names

asd_fns <- rep(asd_fn, times = 4)
print(asd_fns) # (in this case, 4 times the same file)

m2 <- get_spectra(asd_fns)
matplot(t(m2), type = 'l')

asdreader documentation built on May 2, 2019, 5:32 a.m.