sen2cor | R Documentation |
The function uses Sen2Cor to manually correct L1C products. Standalone version of sen2cor (version 2.8.0 or 2.5.5) is used.
sen2cor(
l1c_prodlist = NULL,
l1c_dir = NULL,
outdir = NULL,
proc_dir = NA,
tmpdir = NA,
rmtmp = TRUE,
gipp = NULL,
use_dem = NA,
tiles = NULL,
parallel = FALSE,
timeout = 0,
kill_errored = FALSE,
overwrite = FALSE,
.log_message = NA,
.log_output = NA
)
l1c_prodlist |
List of L1C product names to be corrected. They can be both product names with full/relative path or only names of SAFE products (in this case, also l1c_dir argument must be provided). SAFE products must be unzipped. Note that, at this stage, all products must be in the same directory (this will be fixed). |
l1c_dir |
Full or relative path of input L1C products.
If NULL (default), |
outdir |
Directory where output L2A products will be placed.
If NULL (default), each product is left in the parent directory of |
proc_dir |
(optional) Directory where processing is applied.
If NA (default), processing is done in |
tmpdir |
(optional) Path where processing is performed if a temporary
working directory is required (see argument |
rmtmp |
(optional) Logical: should temporary files be removed? (Default: TRUE) |
gipp |
(optional) Ground Image Processing Parameters (GIPP)
to be passed to Sen2Cor.
It is possible to specify both the path of an existing XML file
or a list of parameters in the form For details about the GIPP parameters, refer to the Sen2Cor documentation
(v. 2.5.5
or 2.8.0:
see the "Schemas of the GIPP file" at the end of each page).
Note: this argument takes effect only in the current execution of
|
use_dem |
(optional) Logical: if TRUE, Sen2Cor is set to use a Digital Elevation Model for topographic correction (reflecting what is done for Level-2A SAFE images provided by ESA Hub); if FALSE, it is set not to perform topographic correction (reflecting the current default Sen2Cor behaviour); if NA (default), the option set in the XML GIPP configuration file used by sen2r (stored in the default sen2r settings directory) is respected; in case the user never edited it, the current default setting is not to perform topographic correction. Notes:
|
tiles |
Vector of Sentinel-2 Tile strings (5-length character) to be processed (default: process all the tiles found in the input L1C products). |
parallel |
(optional) Logical: if TRUE, Sen2Cor instances are launched
in parallel using multiple cores; if FALSE (default), they are launched in
series on a single core.
The number of cores is automatically determined; specifying it is also
possible (e.g. |
timeout |
Integer value: number of minutes after which killing Sen2Cor if it is still running (default, 0, means that this is never done). This can be useful in case Sen2Cor produced an error without exiting from Python (leaving a standing process running). |
kill_errored |
Logical: experimental feature allowing killing dead Sen2Cor
processes, so leaving |
overwrite |
Logical value: should existing output L2A products be overwritten? (default: FALSE) |
.log_message |
(optional) Internal parameter
(it is used when the function is called by |
.log_output |
(optional) Internal parameter
(it is used when the function is called by |
Vector character with the list ot the output products (being corrected or already existing).
License: GPL 3.0
Luigi Ranghetti, phD (2019)
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:
# Download an L1C SAFE product
example_s2_list <- s2_list(
spatial_extent = st_sfc(st_point(c(12.0, 44.8)), crs=st_crs(4326)),
tile = "32TQQ",
time_interval = as.Date(c("2017-05-01","2017-07-30"))
)
s2_download(example_s2_list, outdir = tempdir())
# Correct it applying a topographic correction
sen2cor(
names(example_s2_list)[1],
l1c_dir = tempdir(),
outdir = tempdir(),
use_dem = TRUE
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.