getHdf: Create or Update Local Subset of Online MODIS Data Pool

Description Usage Arguments Value Author(s) References Examples

Description

Create or update a local user-defined subset of the global MODIS grid data archive. Based on user-specific parameters the function checks in the local archive for available data and downloads missing data from the online MODIS data pool. When run in a schedule job, the function manage the continuous update of the local MODIS data archive.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## S4 method for signature 'character'
getHdf(
  product,
  HdfName,
  begin = NULL,
  end = NULL,
  tileH,
  tileV,
  extent,
  collection = NULL,
  checkIntegrity = TRUE,
  forceDownload = TRUE,
  ...
)

## S4 method for signature 'missing'
getHdf(HdfName, checkIntegrity = TRUE, ...)

Arguments

product

character. MODIS grid product to be downloaded, see getProduct. Use dot notation to address Terra and Aqua products (e.g. M.D13Q1).

HdfName

character vector or list. Full HDF file name(s) to download a small set of files. If specified, other file-related parameters (i.e., begin, end, collection, etc.) are ignored.

begin, end

Date or character. Begin and end date of MODIS time series, see transDate.

tileH, tileV

numeric or character. Horizontal and vertical tile number, see getTile.

extent

See Details in getTile.

collection

Desired MODIS product collection as character, integer, or list as returned by getCollection.

checkIntegrity

logical. If TRUE (default), the size of each downloaded file is checked. In case of inconsistencies, the function tries to re-download broken files.

forceDownload

logical. If TRUE (default), try to download data irrespective of whether online information could be retrieved via MODIS:::getStruc or not.

...

Further arguments passed to MODISoptions, eg 'wait'.

Value

An invisible vector of downloaded data and paths.

Author(s)

Matteo Mattiuzzi

References

MODIS data is currently available from the online data pools at

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
## Not run: 
# One or more specific file (no regular erpression allowed here)
a <- getHdf(HdfName = c("MYD11A1.A2009001.h18v04.006.2015363221538.hdf", 
                        "MYD11A1.A2009009.h18v04.006.2015364055036.hdf", 
                        "MYD11A1.A2009017.h18v04.006.2015364115403.hdf"))
a

# Get all MODIS Terra and Aqua M*D11A1 data from the past 30 days
# (can be run in a scheduled job for regular archive update)
b1 <- getHdf(product = "M.D13A2", begin = Sys.Date() - 30, 
             tileH = 18:19, tileV = 4) 
b1               

# Same tiles with a 'list' extent
Austria <- extent(9.2, 17.47, 46.12, 49.3)
b2 <- getHdf(product = "MOD13A2", begin = "2020001", end = "2020031", extent = Austria)
b2

# Using country boarders from 'mapdata' package
c <- getHdf(product = "MOD13A2", begin = "2016180", end = "2016210",
            extent = "Luxembourg")
c             
       
# Interactive selection of spatial extent, see getTile()
d <- getHdf(product = "MOD13A2", begin = "2016180", end = "2016210")
d

## End(Not run)

MODIS documentation built on Nov. 12, 2020, 5:06 p.m.