getCollection: Get Available Collections of MODIS Product(s)

View source: R/getCollection.R

getCollectionR Documentation

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

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.

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.

Author(s)

Matteo Mattiuzzi, Florian Detsch

See Also

getProduct().

Examples

## Not run: 

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

## End(Not run)


MatMatt/MODIS documentation built on Feb. 1, 2023, 12:39 a.m.