SRF_simulate: Simulation of hyperspectral data by spectral response...

Description Usage Arguments Value See Also Examples

View source: R/tools.R

Description

Simulate hyperspectral Rrs to multispectral bands via sensors SRF (Spectral response function).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
SRF_simulate(
  Rrs,
  select_sensor = "All",
  input_wv_as_column = FALSE,
  output_wavelength = "MED",
  save_as_csv = FALSE,
  save_csv_dir = ".",
  na.rm = TRUE,
  output_wv_as_column = TRUE,
  verbose = FALSE
)

show_sensor_names()

Arguments

Rrs

A data.frame with colnames like "Wavelength and SampleNames" of which the first column is wavelength vector (such as 400:900).

select_sensor

Character. Select sensors. Use show_sensor_names() to print all supported sensors. Default as All

input_wv_as_column

Logical. If FALSE (default), the input data.frame has wavelength as its column names.

output_wavelength

Character. MED (default) or MAX. Define the center wavelength. MED means the center wavelength is middle position of half maximun of max peak. While MAX means the position at the maximun of SRF peak.

save_as_csv

Logical. Choose to save the simulation results as single csv for each sensor. Default with FALSE

save_csv_dir

The directory used for saving ouput csv files. Default as current working directory (".").

na.rm

Logical. Should NA values be removed? Default as TRUE

output_wv_as_column

Logical. If TRUE (default), the output result is a dataframe with wavelength as column names.

verbose

Whether to print information to console. Default as FALSE.

Value

A list with names as all selected sensors from parameters select_sensor. For each list, including five elements:

See Also

Other Utils: cal.metrics.vector(), cal.metrics(), level_to_variable(), trim_sd()

Examples

1
2
3
4
5
6
7
8
library(FCMm)
nm <- seq(400, 900)
Rrs <- data.frame(nm=nm, Site1=exp(nm/1000)+runif(501))
# save simulations in the variable `result` 
result <- SRF_simulate(Rrs,select_sensor=c("OLCI","MODIS"))
# save simulations in the disk
result <- SRF_simulate(Rrs,select_sensor=c("OLCI","MODIS"),
  save_as_csv = TRUE, save_csv_dir = tempdir())

bishun945/FCMm documentation built on Oct. 15, 2021, 6:43 p.m.