This function provides a convenient way to call the ED radiative transfer module (EDR, which simulates full spectral return of an ED patch for a given point in time) directly from R.
Usage
EDR(
img_path,
ed2in_path,
spectra_list,
trait.values,
soil_reflect_path = system.file("extdata", "soil_reflect_par.dat", package =
"PEcAnRTM"),
wood_reflect_path = system.file("extdata", "wood_reflect_par.dat", package =
"PEcAnRTM"),
par.wl = 400:2499,
nir.wl = 2500,
edr_exe_path = NULL,
output.path = dirname(normalizePath(ed2in_path, mustWork = TRUE)),
settings = list(model = list(revision = "git", config.header = NULL)),
singularity_args = list(),
clean = FALSE,
stderr = TRUE,
verbose_error = TRUE,
...
)Arguments
- img_path
Path to Singularity container (usually a
.simgfile)- ed2in_path
Path to ED2IN file.
- spectra_list
List of spectral data matrices. Names must exactly match the PFTs given in
trait.values. Each item must be a matrix of reflectance (labeled 'R' or 'reflectance') and transmittance (labeled 'T' or 'transmittance') values. If the matrix is not of classspectra(seespectra()), it must also have a column of wavelength values (labeled 'wl'). Such a matrix is returned by default by all versions of PROSPECT in this package.- trait.values
Named, hierarchical list of trait values for generating config.xml file. Names must be PFTs, and must exactly match names of
spectra_list.- soil_reflect_path
Path to soil reflectance file (defaults to spectra in package
extdata)- wood_reflect_path
Path to wood reflectance file (defaults to spectra in package
extdata)- par.wl
Vector of wavelengths defining PAR region
- nir.wl
Vector of wavelengths defining NIR region
- edr_exe_path
If
img_pathisNULL, a full path to the EDR executable. Ignored otherwise.- output.path
Directory in which to execute the run. Defaults to
dirname(ed2in_path).- settings
PEcAn settings list. Default is
list(model = list(revision = "git", config.header = NULL)).- singularity_args
Additional arguments to be passed to
singularity run(before)- clean
Logical. If
TRUE, remove all files generated by this function (e.g. cloned history file, ED2IN, output HDF files).- stderr
Logical. If
TRUE(default), internalizesystem2results as R character vector.TRUEis recommended because it allows EDR to check its execution and to run more quietly.- verbose_error
Logical. If
TRUE(default), spit out the full ED if EDR execution fails.- ...
Additional arguments to
system2