extract.metadata: Extract metadata for each spectra sample. Works on a single...

View source: R/spec.utils.R

extract.metadataR Documentation

Extract metadata for each spectra sample. Works on a single spectra or a directory.

Description

Extract metadata for each spectra sample. Works on a single spectra or a directory.

Usage

extract.metadata(
  file.dir = NULL,
  out.dir = NULL,
  instrument = NULL,
  spec.file.ext = NULL,
  output.file.ext = ".csv",
  tz = NULL,
  settings.file = NULL
)

Arguments

file.dir

File directory or filename of single spectra for processing

out.dir

Output directory for metadata information file

instrument

What instrument was used to collect spectra. Current options: ASD, SE, SVC

spec.file.ext

[Optional] Input spectra file extension. E.g. .asd (ASD), .sed (Spectral Evolution), or .sig (Spectra Vista). Default for ASD instruments is .asd. Default for Spectral Evolution instruments is .sed. Default for Spectra Vista is .sig

output.file.ext

[Optional] Output file extension of metadata information file. Default .csv

tz

[Optional] Set the timezone of the spectra file collection. Used to covert spectra collection time to UTC. If unused it is assumed that the correct timezone is the current system timezone.

settings.file

[Optional] Spectral settings file

Value

output Returns a dataframe of spectral metadata information

Author(s)

Shawn P. Serbin

Examples

# ASD
file <- system.file("extdata/PM01_TIAM_B_LC_REFL00005.asd",package="FieldSpectra")
output <- extract.metadata(file,instrument="ASD")

# Spectral Evolution
file <- system.file("extdata/cvars_grape_leaf1_lc_rg_01236.sed",package="FieldSpectra")
output <- extract.metadata(file,instrument="SE")

# Spectra Vista
file <- system.file("extdata/gr070214_003.sig",package="FieldSpectra")
output <- extract.metadata(file,instrument="SVC")

file <- system.file("extdata/BEO_CakeEater_Pheno_026_resamp.sig",package="FieldSpectra")
output <- extract.metadata(file,instrument="SVC")


serbinsh/R-FieldSpectra documentation built on March 31, 2022, 10:08 p.m.