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)
}
Run the code above in your browser using DataLab