View source: R/safe_shortname.R
safe_shortname | R Documentation |
This function renames a Sentinel-2 product in order to obtain shorten names. See the details for the structure of the adopted schema (named "sen2r naming convention"). The function applies only to compact product names (not to single granule names), since it is thought to be applied to entire products. Old long names are no more supported.
safe_shortname(
prod_name,
prod_type = NULL,
ext = NULL,
res = "10m",
tiles = NULL,
force_tiles = NULL,
full.name = TRUE,
allow_duplicated = FALSE,
set.seed = NULL,
multiple_names = NULL,
abort = FALSE
)
prod_name |
Input Sentinel-2 product name (it is not required that the file exists). |
prod_type |
(optional) Output product (default: |
ext |
(optional) Extension of the output filename (default: none). |
res |
(optional) Spatial resolution (one between '10m', '20m' or '60m');
default is '10m'. Notice that, choosing '10m' or '20m', bands with lower
resolution will be rescaled to |
tiles |
Deprecated (no more used). |
force_tiles |
Deprecated (no more used). |
full.name |
Logical value: if TRUE (default), all the input path is maintained (if existing); if FALSE, only basename is returned. |
allow_duplicated |
Logical value: if TRUE, duplicated values are
maintained; if FALSE (default), in case of duplicated value a suffix is
added to the tile ID (see |
set.seed |
Deprecated (no more used). |
multiple_names |
Deprecated (no more used). |
abort |
Logical parameter: if TRUE, the function aborts in case
|
ESA Sentinel-2 naming convention is particularly long-winded. So, the convention here adopted, named "sen2r naming convention", follows this schema:
S2mll_yyyymmdd_rrr_ttttt_ppp_rr.fff
where:
S2mll
(length: 5) shows the mission ID (S2A
or S2B
) and the product level
(1C
or 2A
);
yyyymmdd
(length: 8) is the sensing date (e.g. 20170603
for 2017-06-03) ; the
hour is skipped, since a single sensor can not pass two times in a
day on the same tile);
rrr
(length: 3) is the relative orbit number (e.g. 022
);
ttttt
(length: 5) is the tile number (e.g. 32TQQ
);
ppp
(length: 3) is the output product, being one of these:
for level 1C:
TOA
: 13-bands Top-Of-Atmosphere Reflectance;
for level 2A:
BOA
: 13-bands Bottom-Of-Atmosphere Reflectance;
TCI
: True Colour Image (3-band RGB 8-bit image);
AOT
: Aerosol Optical Thickness;
WVP
: Water Vapour;
SCL
: Scene Classification Map;
CLD
: Quality Indicators for cloud probabilities;
SNW
: Quality Indicators for snow probabilities;
VIS
: TODO Visibility (used for AOT);
for both levels:
SZA
: Sun Zenith Angles;
SAA
: Sun Azimuth Angles;
OZA
: averaged Viewing Incidence Zenith Angles;
OAA
: averaged Viewing Incidence Azimuth Angles.
rr
(length: 2) is the original minimum spatial resolution in metres
(10, 20 or 60);
fff
(length: variable, generally 3) is the file extension.
Output product name
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/.
safe_shortname("S2A_MSIL1C_20170603T101031_N0205_R022_T32TQQ_20170603T101026.SAFE", ext="tif")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.