modGetDates: Return the capturing dates of MODIS images

Description Usage Arguments Details Value Examples

View source: R/genMissionGetDates.R

Description

modGetDates reads the official name of MODIS images and returns its capturing date, as Date class object.

Usage

1

Arguments

str

the full path(s) or official name(s) of MODIS images from which the capturing date is retrieved.

...

arguments for nested functions:

  • format the format of the date being returned.

Details

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 list of characters. Dates are returned as 'YYYY-mm-dd' by default. If another format is required, it can be modified through the argument format.

Value

a Date class object with the date of the MODIS image or character class, if format argument is used.

Examples

1
2
3
4
5
6
7
8
# getting the capturing date from the name of a MODIS image
file.mod <- 'MYD13A2.A2016361.h17v04.006.2017285133407.hdf'
modGetDates(file.mod)

# a list of the full file paths of MODIS images, mixing .hdf and .tif files
file.mod<-list('MYD13A2.A2013297.h17v04.006.2015269230726.hdf',
               'MYD13A2.A2013313.h17v04.006.2015271071143.tif')
modGetDates(file.mod, format = "%Y%j")

RGISTools documentation built on July 2, 2020, 3:58 a.m.