Lists all available dates for a MODIS Land Products Subset product at a particular location.
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.
a valid MODIS product name
band to download
start date
end date
km left-right to sample
km above-below to sample
location where to store all data
should the data be returned as an internal data structure
TRUE
or FALSE
(default = TRUE
)
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.
if (FALSE) {
# 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)
# 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, file.path(tempdir(),"my_sites.csv"),
quote = FALSE,
row.names = FALSE,
col.names = TRUE,
sep = ",")
# test batch download form CSV
subsets <- mt_batch_subset(df = file.path(tempdir(),"my_sites.csv"),
product = "MOD11A2",
band = "LST_Day_1km",
internal = TRUE,
start = "2004-01-01",
end = "2004-03-31"
)
head(subsets)
}