MODIS (version 1.0.0)

getCollection: Get Available Collections of MODIS Product(s)

Description

Checks and retrieves available MODIS collection(s) for a given product.

Usage

getCollection(product, collection = NULL, newest = TRUE,
  forceCheck = FALSE, as = "character", quiet = TRUE, ...)

Arguments

product

character. MODIS grid product to check for existing collections, see getProduct.

collection

character or integer. If provided, the function only checks if the specified collection exists and returns the collection number formatted based on the as parameter or FALSE if it doesn't exists. The check is performed on the primary data source, 'LP DAAC' https://lpdaac.usgs.gov/.

newest

logical. If TRUE (default), return only the newest collection, else return all available collections.

forceCheck

logical, defaults to FALSE. If TRUE, connect to the 'LP DAAC' FTP server and get available collections, of which an updated version is permanently stored in MODIS:::combineOptions()$auxPath.

as

character, defaults to 'character' which returns the typical 3-digit collection number (i.e., "005"). as = 'numeric' returns the result as numeric (i.e., 5).

quiet

logical, defaults to TRUE.

...

Additional arguments passed to MODIS:::combineOptions.

Value

A 3-digit character or numeric object (depending on 'as') or, if length(product) > 1, a list of such objects with each slot corresponding to the collection available for a certain product. Additionally, a text file in a hidden folder located in getOption("MODIS_localArcPath") as database for future calls. If 'collection' is provided, only the (formatted) collection (or FALSE if it could not be found) is returned.

See Also

getProduct.

Examples

Run this code


# update or get collections for MOD11C3 and MYD11C3
getCollection(product="M.D11C3")
getCollection(product="M.D11C3",newest=FALSE)

getCollection(product="M.D11C3",collection=3)
getCollection(product="M.D11C3",collection=41)
getCollection(product="M.D11C3",collection="041")
getCollection(product="M.D11C3",forceCheck=TRUE)


Run the code above in your browser using DataLab