Description Usage Arguments Value
View source: R/preprocessing.R
The function is a wrapper to perform the entire
processing chain to find, download and pre-process Sentinel-2
data. Input is a set of parameters that can be passed with a
list or file (parameter param_list
) or singularly (see the
descriptions of all the other parameters).
1 | preprocessing(param_list = NULL)
|
param_list |
(optional) List of input parameters:
it can be both an R list or the path of a JSON file.
If some parameters are passed both as elements of |
online |
(optional) Logical: TRUE (default) to search for available products on SciHub (and download if needed); FALSE to work only with already downloaded SAFE products. |
api |
Path of the text file containing credentials of cnes account. If NA (default) the default credentials (username "email", password "password") will be used. |
downloader |
(optional) Character value corresponding to the executable which should be used to download SAFE products. It could be one among "wget" (default) and "aria2". If aria2 is not installed, Wget will be used instead. |
overwrite_product |
(optional) Logical: TRUE to overwrite existing products with products found online or manually corrected, FALSE (default) to skip download for products already existing. |
timewindow |
(optional) Temporal window for querying: Date object of length 1 (single day) or 2 (time window). Default is NA, meaning that no filters are used if online = FALSE, and all found images are processed; if online = TRUE, last 90 days are processed. Is it possible to pass also integer (or difftime) values, which are interpreted as the last n days. |
timeperiod |
(optional) Character:
|
extent |
(optional) Spatial extent on which to clip products (it can be both the path of a vector file or a geoJSON). Default is NA for offline mode (meaning no extent: all found tiles are entirely used); in online mode, a sample extent is used as default. |
list_rgb |
(optional) Character vector with the values of the RGB images to be produced. Images are in the form xRGBrgb, when:
|
index_source |
(optional) Character value: if "BOA" (default), indices are computed from BOA values; if "TOA", non corrected reflectances are instead used (be careful to use this setting!). |
mask_type |
(optional) Character value which determines the categories
in the Surface Classification Map to be masked (see |
max_mask |
(optional) Numeric value (range 0 to 100), which represents
the maximum percentage of allowed masked surface (by clouds or any other
type of mask chosen with argument |
mask_smooth |
(optional) Numeric positive value: the smoothing radius (expressed in unit of measure of the output projection, typically metres) to be applied to the cloud mask by function s2_mask. |
mask_buffer |
(optional) Numeric value: the buffering radius (expressed in unit of measure of the output projection, typically metres) to be applied to the cloud mask by function s2_mask. Default value (0) means that no buffer is applied; a positive value causes an enlargement of the masked area; a negative value cause a reducement. |
resampling |
(optional) Resampling method (one of the values supported
by |
resampling_scl |
(optional) Resampling method for categorical products (for now, only SCL): one among "near" (default) and "mode". |
outformat |
(optional) Format of the output file (in a format recognised by GDAL). Default is "GTiff". |
rgb_outformat |
(optional) Format of the output RGB products (in a format recognised by GDAL). Default is "GTiff". |
index_datatype |
(optional) Numeric datatype of the ouptut spectral indices. |
compression |
(optional) In the case GTiff is chosen as output format, the compression indicated with this parameter is used (default is "DEFLATE"). |
rgb_compression |
(optional) In the case GTiff is chosen as output format for RGB products, the compression indicated with this parameter is used (default is "DEFLATE"). In the cases GTiff or JPEG are chosen as output format for RGB products, this parameter can also be a 1-100 integer value, which is interpreted as the compression level for a JPEG compression. |
overwrite |
(optional) Logical value: should existing output files be overwritten? (default: FALSE). |
path_theia_landsat |
(optional) Path of the directory in which THEIA LANDSAT products are searched and/or downloaded. If not provided (default), a temporary directory is used. |
path_theia_spotworldheritage |
(optional) Path of the directory in which THEIA SpotWorldHeritage products are searched, downloaded and/or generated. If not provided (default), a temporary directory is used. |
path_theia_sentinel2 |
(optional) Path of the directory in which THEIA Sentinel2 products are searched and/or downloaded. If not provided (default), a temporary directory is used. |
path_theia_snow |
(optional) Path of the directory in which THEIA Snow products are searched, downloaded and/or generated. If not provided (default), a temporary directory is used. |
path_theia_venus |
(optional) Path of the directory in which THEIA VENUS products are searched, downloaded and/or generated. If not provided (default), a temporary directory is used. |
path_out |
(optional) Path of the directory in which Sentinel-2 output products are searched and/or generated. If not provided (default), a temporary directory is used. |
path_rgb |
(optional) Path of the directory in RGB products
are searched and/or generated.
If not provided (default), |
path_indices |
(optional) Path of the directory in which files of
spectral indices are searched and/or generated.
If not provided (default), |
thumbnails |
(optional) Logical: if TRUE (default), a thumbnail is added for each product created. Thumbnails are JPEG or PNG georeferenced small images (width or height of 1024 pixels) with default colour palettes (for more details, see the help window in the GUI). They are placed in a subdirectory of the products names "thumbnails". If FALSE, they are not created. |
parallel |
(optional) Logical or integer: if TRUE (default), some
functions (sen2cor, s2_mask and s2_calcindices for now)
are executed using multiple cores in order to speed up the execution.
The number of cores is automatically determined; specifying it is also
possible (e.g. |
use_python |
(optional) Logical: if TRUE (default), the presence of
python in the system is checked before running the function;
if FALSE, this is skipped. Setting this to FALSE can bge useful on
systems with problems with python, when |
tmpdir |
(optional) Path where intermediate files will be created.
Default is a temporary directory (unless |
rmtmp |
(optional) Logical: should temporary files be removed?
(Default: TRUE). |
log |
(optional) Character string with the path where the package messages will be redirected. Default (NA) is not to redirect (use standard output). A two-length character with tho paths (which can also coincide) can be used to redirect also the output: in this case, the first path |
product |
Product |
theiacollection |
Theia collection |
pepscollection |
Peps collection |
theiaplatformlandsat |
Platform THEIA landsat |
theiaplatformspotworldheritage |
Platform THEIA Spot World Heritage |
theiaplatformsentinel |
Platform THEIA SENTINEL 2 |
theiaplatformvenus |
Platform THEIA VENUS |
extent_name |
Extent name |
list_indices_checked |
List indices checked |
reference_path |
is the path for messages, the second one for the output. |
A vector with the paths of the files which were created (excluded the temporary files); NULL otherwise. The vector includes two attributes:
cloudcovered
with the list of imags not created due to the higher
percentage of cloud covered pixels;
missing
with the list of imags not created due to other reasons.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.