View source: R/genMissionGetDates.R
senGetDates | R Documentation |
senGetDates
reads the official name of a Sentinel-2 image and returns
the capturing date, as a Date
class object.
senGetDates(str, ...)
str |
the full path(s) or official name(s) of the Sentinel images from which the capturing date is retrieved. |
... |
arguments for nested functions:
|
The function works with file names (or their paths) regardless of their
extension. The function accepts more than on file path, which can be passed
as a vector of character
s. Dates are returned as 'YYYY-mm-dd
' by
default. If another format is required, it can be modified through the
argument format
.
a Date
class object with the date of the Sentinel image or character
class,
if the format
argument is used.
# getting the capturing date from the name of Sentinel-2 images file.sen <- c("S2A_MSIL1C_20170102T111442_N0204_R137_T30TWN_20170102T111441.SAFE", "S2A_OPER_PRD_MSIL1C_PDMC_20160308T090616_R094_V20160305T110109_20160305T110109") date.sen <- senGetDates(file.sen) print(date.sen) print(format(date.sen,"%Y%j")) senGetDates(file.sen, format = "%Y%j")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.