Learn R Programming

spectrolab (version 0.0.12)

read_spectra: Read files from various formats into `spectra`

Description

Read files from various formats into `spectra`

Usage

read_spectra(
  path,
  format,
  type = "target_reflectance",
  recursive = FALSE,
  exclude_if_matches = NULL,
  ignore_extension = FALSE,
  ...
)

Arguments

path

Path to directory or input files

format

file formats. "asd" (for ASD); "sig" or "svc" (for SVC); "sed" or "psr" (for SpecEvo PSR).

type

Data type to read. "target_reflectance", "target_radiance", or "reference_radiance". Defaults to "target_reflectance".

recursive

read files recursively

exclude_if_matches

excludes files that match this regular expression. Example: "BAD"

ignore_extension

boolean. If TRUE, the parser will try to read every file in path regardless of the expected extension.

...

nothing yet

Value

a single `spectra` or a list of `spectra` (in case files have incompatible band number or bands values)

Examples

Run this code
# NOT RUN {
library(spectrolab)
dir_path = system.file("extdata", "Acer_example", package = "spectrolab")

# Relative reflectance is re
spec     = read_spectra(path = dir_path, format = "sig")
# }

Run the code above in your browser using DataLab