Lists all available dates for a MODIS Land Products Subset product at a particular location.

mt_batch_subset(
  df,
  product,
  band,
  start = "2000-01-01",
  end = format(Sys.time(), "%Y-%m-%d"),
  km_lr = 0,
  km_ab = 0,
  out_dir = tempdir(),
  internal = TRUE,
  ncores = "auto"
)

Arguments

df

a CSV file or data frame holding locations and their sitenames to batch process with column names site_name, lat, lon holding the respective sitenames, latitude and longitude. When providing a CSV make sure that the data are comma separated.

product

a valid MODIS product name

band

band to download

start

start date

end

end date

km_lr

km left-right to sample

km_ab

km above-below to sample

out_dir

location where to store all data

internal

should the data be returned as an internal data structure TRUE or FALSE (default = TRUE)

ncores

number of cores to use while downloading in parallel (auto will select the all cpu cores - 1 or 10)

Value

A data frame combining meta-data and actual data values, data from different sites is concatenated into one large dataframe. Subsets can be created by searching on sitename.

See also

Examples

# \donttest{ # create data frame with a site_name, lat and lon column # holding the respective names of sites and their location df <- data.frame("site_name" = paste("test",1:2)) df$lat <- 40 df$lon <- -110 print(df)
#> site_name lat lon #> 1 test 1 40 -110 #> 2 test 2 40 -110
# test batch download subsets <- mt_batch_subset(df = df, product = "MOD11A2", band = "LST_Day_1km", internal = TRUE, start = "2004-01-01", end = "2004-03-31") # the same can be done using a CSV file with # a data structure similar to the dataframe above write.table(df, "my_sites.csv", quote = FALSE, row.names = FALSE, col.names = TRUE, sep = ",") # test batch download form CSV subsets <- mt_batch_subset(df = "./my_sites.csv", product = "MOD11A2", band = "LST_Day_1km", internal = TRUE, start = "2004-01-01", end = "2004-03-31") head(subsets)
#> xllcorner yllcorner cellsize nrows ncols band units #> 1.1.1 -9370036.39 4447802.08 926.625433055834 1 1 LST_Day_1km Kelvin #> 1.2.1 -9370036.39 4447802.08 926.625433055834 1 1 LST_Day_1km Kelvin #> 1.3.1 -9370036.39 4447802.08 926.625433055834 1 1 LST_Day_1km Kelvin #> 1.4.1 -9370036.39 4447802.08 926.625433055834 1 1 LST_Day_1km Kelvin #> 1.5.1 -9370036.39 4447802.08 926.625433055834 1 1 LST_Day_1km Kelvin #> 1.6.1 -9370036.39 4447802.08 926.625433055834 1 1 LST_Day_1km Kelvin #> scale latitude longitude site product start end complete #> 1.1.1 0.02 40 -110 test 1 MOD11A2 2004-01-01 2004-03-31 TRUE #> 1.2.1 0.02 40 -110 test 1 MOD11A2 2004-01-01 2004-03-31 TRUE #> 1.3.1 0.02 40 -110 test 1 MOD11A2 2004-01-01 2004-03-31 TRUE #> 1.4.1 0.02 40 -110 test 1 MOD11A2 2004-01-01 2004-03-31 TRUE #> 1.5.1 0.02 40 -110 test 1 MOD11A2 2004-01-01 2004-03-31 TRUE #> 1.6.1 0.02 40 -110 test 1 MOD11A2 2004-01-01 2004-03-31 TRUE #> modis_date calendar_date tile proc_date pixel value #> 1.1.1 A2004001 2004-01-01 h09v05 2015212185706 1 13098 #> 1.2.1 A2004009 2004-01-09 h09v05 2015212201022 1 13062 #> 1.3.1 A2004017 2004-01-17 h09v05 2015212213103 1 13297 #> 1.4.1 A2004025 2004-01-25 h09v05 2015213005429 1 13323 #> 1.5.1 A2004033 2004-02-02 h09v05 2015213090158 1 13315 #> 1.6.1 A2004041 2004-02-10 h09v05 2015213165253 1 13227
# }