read_gipp | R Documentation |
read_gipp()
reads Ground Image Processing Parameters (GIPP)
from the default sen2r GIPP path or from an XML file.
set_gipp()
modifies values of a list of GIPP in an XML file
(or creates a new XML file with the desired GIPP).
read_gipp(gipp_names, gipp_path = NA)
set_gipp(gipp = list(), gipp_path = NA, use_dem = NA)
gipp_names |
Character vector with the names of the parameters to be read. |
gipp_path |
Character path of the GIPP XML file to be read
( |
gipp |
(optional) Ground Image Processing Parameters (GIPP)
(see |
use_dem |
Logical, determining if a DEM should be set for being used
for topographic correction in the XML specified with argument |
In set_gipp()
, editing /resetting
the default sen2r GIPP XML file was disabled to grant code reproducibility
among different machines (an error is returned if gipp_path
is not set).
Users who want to do that (being aware of the risk doing that)
must explicitly define the argument gipp_path
as the path of the default GIPP file, which is
file.path(dirname(attr(load_binpaths(), "path")), "sen2r_L2A_GIPP.xml")
.
read_gipp()
returns a named list of GIPP with the required parameters
(values not found in the XML are skipped).
set_gipp()
returns NULL (the function is called for its side effects).
License: GPL 3.0
Luigi Ranghetti, phD (2020)
L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.cageo.2020.104473")}, URL: https://sen2r.ranghetti.info/.
## Not run:
if (!is.null(load_binpaths()$sen2cor)) {
# Read default values
read_gipp(c("dem_directory", "dem_reference"))
# Set the use of a topographic correction
set_gipp(use_dem = TRUE, gipp_path = gipp_temp <- tempfile())
# Read the parameters in the created temporary files
read_gipp(c("DEM_Directory", "DEM_Reference"), gipp_path = gipp_temp)
# Set not to use a topographic correction
set_gipp(use_dem = FALSE, gipp_path = gipp_temp <- tempfile())
# This is equivalent to:
# set_gipp(
# list(DEM_Directory = NA, DEM_Reference = NA),
# gipp_path = gipp_temp <- tempfile()
# )
# Read again the parameters in the created temporary files
read_gipp(c("DEM_Directory", "DEM_Reference"), gipp_path = gipp_temp)
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.