Learn R Programming

MODIS (version 1.2.11)

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",
  ...
)

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.

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 LP DAAC as the exclusive source for several products or, for snow cover (MOD/MYD10) and sea ice extent (MOD/MYD29), NSIDC.

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 or NSIDC 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., "061"). as = "numeric" returns the result as numeric (i.e., 61).

...

Additional arguments passed to MODISoptions(). Permanent settings for these arguments are temporarily overridden.

Author

Matteo Mattiuzzi, Florian Detsch

See Also

getProduct().

Examples

Run this code
if (FALSE) {

# update or get collections for MCD12C1 and MCD12Q1
getCollection(product = "MCD12.*")
getCollection(product = "MCD12.*", newest = FALSE)
getCollection(product = "MCD12.*", forceCheck = TRUE)
}

Run the code above in your browser using DataLab