- s2
Sentinel-2 products, which can be:
a list of products in the format safelist
(see safelist);
a vector of SAFE paths;
a vector of paths of xml product files with metadata.
If the product does not exist locally, the function can run only with
option info = "nameinfo"
(see below).
- info
(optional) A character vector with the list of the metadata
which should be provided.
Accepted values are:
"all"
(default): all the retrievable metadata are provided;
"fileinfo"
: only the metadata obtained by scanning the file name
and product structure (without opening it with GDAL) are provided.
"nameinfo"
: only the metadata obtained by scanning the file name
are provided (it is faster and there is no need to have downloaded
yet the file).
a vector of single specific information (one or more from the
followings):
"name"
(SAFE name - this is always returned);
"validname"
(TRUE or FALSE);
"exists"
(TRUE or FALSE);
"prod_type"
('singlegranule' or 'product');
"version"
('old'
or 'compact'
);
"tiles"
(vector with the tiles ID available in the product);
"utm"
(vector with the UTM zones used in the product);
"xml_main"
(name of the main XML file with metadata);
"xml_granules"
(names of the XML with granule metadata);
"level"
('1C'
or '2A'
);
"creation_datetime"
, "id_tile"
, "mission"
, "centre"
,
"file_class"
, "id_orbit"
, "orbit_number"
,
"sensing_datetime"
, "id_baseline"
: metadata specific of
the product type and version (they are returned only if
obtainable for the specified input);
"clouds"
, "direction"
, "orbit_n"
, "preview_url"
,
"proc_baseline"
, "level"
, "sensing_datetime"
,
"nodata_value"
, "saturated_value"
:
information retrieved from the metadata stored in the XML file;
"res"
: resolutions with all the output products available;
"jp2list"
(data.frame with the list of the JP2 band files -
asking for this info will cause format
to be coerced to "list"
).
"offset"
(named vector with the offset values of each band -
asking for this info will cause format
to be coerced to "list"
).
Notice that the required info are returned only if available;
i.e., if some info requiring existing files are asked by the user, but
input SAFE do not exist, only info retrievable by the SAFE name are
returned.
- format
Output format, being one of the followings:
"data.table"
and "data.frame"
: a table with one row per s2
input and one column per required info
;
"list"
: a list (one element per s2
input) in which each element is
a list of the required info
;
"vector"
: a list (one element per info
) in which each element is
a named vector (with s2
length and names) with the required info
;
"default"
(default): "vector"
if info
is of length 1;
"data.table"
otherwise.
- simplify
Logical parameter, which applies in case s2
is of length 1:
in this case, if TRUE (default) and format
is "list"
or "vector"
,
a single info
list or vector is returned;
if FALSE, a list of length 1 (containing the list or vector of the required
s2
product) is returned.
- abort
Logical parameter: if TRUE (default), the function aborts
in case some inputs are not recognised, or if some files do not exists
(in case some info
elements require the files to be present);
if FALSE, a warning is shown.
- allow_oldnames
Logical parameter: if TRUE, old (long) name products
are managed (metadata are returned, and they are considered valid;
if FALSE (default), they are considered as non-supported files.
Note that, from sen2r version 1.1.0, oldname products are no more supported
within processing chains, so this function is deprecated and no more
supported; moreover, it will be removed in next releases.
- req_res
Character: vector of variable length (0 to 3)
containing the names of the spatial resolution to be checked
(one or more among "10m"
, "20m"
and "60m"
).
In case of level 2A-products, the existence of the JP2 files with the
required resolutions necessary for sen2r processing chains (spectral bands
and SCL
) is checked, determining the result of the check.
Default is c("10m","20m","60m")
, since Sen2Cor by default produces
all of these resolutions.
NULL
can be used not to scan for JP2 content.
In case of level-1C products, in which each layer band is available in a
specific resolution, any of the previous values causes all JP2 layers to be
checked, while NULL
causes no scan to be performed (as in the case of L2A).
In safe_isvalid()
, this argument is ignored if check_file = FALSE
.
- check_file
Logical: if TRUE (default), the content of the provided
paths is checked; if FALSE, only the validity of SAFE names is tested.