- Notifications
You must be signed in to change notification settings - Fork0
Interface to the MODIS Land Products Subsets Web Services
License
bluegreen-labs/MODISTools
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Programmatic interface to the‘MODIS Land Products Subsets’ webservices. Allows foreasy downloads of‘MODIS’ time seriesdirectly to your R workspace or your computer. When using the packageplease cite the manuscript as referenced below. Keep in mind that theoriginal manuscript describes versions prior to release 1.0 of thepackage. Functions described in this manuscript do not exist in thecurrent package, please consultthedocumentation to findmatching functionality.
Please cite the package in your work as:
Koen Hufkens. (2023). bluegreen-labs/MODISTools: MODISTools v1.1.5. Zenodo.https://doi.org/10.5281/zenodo.7551164
To install the current stable release use a CRAN repository:
install.packages("MODISTools")library("MODISTools")
To install the development releases of the package run the followingcommands:
if(!require(remotes)){install.package("remotes")}remotes::install_github("bluegreen-labs/MODISTools")library("MODISTools")
Vignettes are not rendered by default, if you want to include additionaldocumentation please use:
if(!require(remotes)){install.package("remotes")}remotes::install_github("bluegreen-labs/MODISTools",build_vignettes=TRUE)library("MODISTools")
To extract a time series of modis data for a given location and itsdirect environment use the mt_subset() function.
detailed parameter description (click to expand)
| Parameter | Description |
|---|---|
| product | a MODIS product |
| band | a MODIS product band (if NULL all bands are downloaded) |
| lat | latitude of the site |
| lon | longitude of the site |
| start | start year of the time series (data start in 1980) |
| end | end year of the time series (current year - 2 years, use force = TRUE to override) |
| internal | logical, TRUE or FALSE, if true data is imported into R workspace otherwise it is downloaded into the current working directory |
| out_dir | path where to store the data when not used internally, defaults to tempdir() |
| km_lr | force “out of temporal range” downloads (integer) |
| km_ab | suppress the verbose output (integer) |
| site_name | a site identifier |
| site_id | a site_id for predefined locations (not required) |
| progress | logical, TRUE or FALSE (show download progress) |
# load the librarylibrary(MODISTools)# download datasubset<- mt_subset(product="MOD11A2",lat=40,lon=-110,band="LST_Day_1km",start="2004-01-01",end="2004-02-01",km_lr=1,km_ab=1,site_name="testsite",internal=TRUE,progress=FALSE)print(str(subset))
The output format is atidy data frame, as shown above. When witten toa csv with the parameterinternal = FALSE this will result in a flatfile on disk.
Note that when a a region is defined using km_lr and km_ab multiplepixels might be returned. These are indexed using thepixel column inthe data frame containing the time series data. The remote sensingvalues are listed in thevalue column. When no band is specified allbands of a given product are returned, be mindful of the fact thatdifferent bands might require different multipliers to represent theirtrue values. To list all available products, bands for particularproducts and temporal coverage see function descriptions below.
When a large selection of locations is needed you might benefit fromusing the batch download functionmt_batch_subset(), which provides awrapper around themt_subset() function in order to speed up largedownload batches. This function has a similar syntax tomt_subset()but requires a data frame defining site names (site_name) and locations(lat / lon) (or a comma delimited file with the same structure) tospecify a list of download locations.
Below an example is provided on how to batch download data for a dataframe of given site names and locations (lat / lon).
# create data frame with a site_name, lat and lon column# holding the respective names of sites and their locationdf<-data.frame("site_name"= paste("test",1:2))df$lat<-40df$lon<--110# test batch downloadsubsets<- mt_batch_subset(df=df,product="MOD11A2",band="LST_Day_1km",internal=TRUE,start="2004-01-01",end="2004-02-01")print(str(subsets))
To list all available products use the mt_products() function.
products<- mt_products()head(products)
To list all available bands for a given product use the mt_bands()function.
bands<- mt_bands(product="MOD11A2")head(bands)
To list all available dates (temporal coverage) for a given product andlocation use the mt_dates() function.
dates<- mt_dates(product="MOD11A2",lat=42,lon=-110)head(dates)
Koen Hufkens. (2023). bluegreen-labs/MODISTools: MODISTools v1.1.5. Zenodo.https://doi.org/10.5281/zenodo.7551164
Original development was supported by the UK Natural EnvironmentResearch Council (NERC; grants NE/K500811/1 and NE/J011193/1), and theHans Rausing Scholarship. Refactoring was supported through the BelgianScience Policy office COBECORE project (BELSPO; grantBR/175/A3/COBECORE). Logo design elements are taken from the FontAwesomelibrary according tothese terms,where the globe element was inverted and intersected.
About
Interface to the MODIS Land Products Subsets Web Services
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.
