Get MODIS data by date and location

call_MODIS(
  var,
  product,
  band,
  site_info,
  product_dates,
  outdir = NULL,
  run_parallel = FALSE,
  ncores = NULL,
  package_method = "MODISTools",
  QC_filter = FALSE,
  progress = FALSE
)

Arguments

var

the simple name of the modis dataset variable (e.g. lai)

product

string value for MODIS product number

band

string value for which measurement to extract

site_info

Bety list of site info for parsing MODIS data: list(site_id, site_name, lat, lon, time_zone)

product_dates

a character vector of the start and end date of the data in YYYYJJJ

outdir

where the output file will be stored. Default is NULL and in this case only values are returned. When path is provided values are returned and written to disk.

run_parallel

optional method to download data paralleize. Only works if more than 1 site is needed and there are >1 CPUs available.

ncores

number of cpus to use if run_parallel is set to TRUE. If you do not know the number of CPU's available, enter NULL.

package_method

string value to inform function of which package method to use to download modis data. Either "MODISTools" or "reticulate" (optional)

QC_filter

Converts QC values of band and keeps only data values that are excellent or good (as described by MODIS documentation), and removes all bad values. qc_band must be supplied for this parameter to work. Default is False. Only MODISTools option.

progress

TRUE reports the download progress bar of the dataset, FALSE omits the download progress bar. Default is TRUE. Only MODISTools option.

Requires Python3 for reticulate method option. There are a number of required python libraries. sudo -H pip install numpy suds netCDF4 json depends on the MODISTools package version 1.1.0

Author

Bailey Morrison

Examples

if (FALSE) { # \dontrun{
site_info <- list(
  site_id = 1,
  site_name = "test",
  lat = 44,
  lon = 90,
  time_zone = "UTC")
test_modistools <- call_MODIS(
  var = "lai",
  product = "MOD15A2H",
  band = "Lai_500m",
  site_info = site_info,
  product_dates = c("2001150", "2001365"),
  outdir = NULL,
  run_parallel = TRUE,
  ncores = NULL,
  package_method = "MODISTools",
  QC_filter = TRUE,
  progress = FALSE)
} # }