Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Interface to the MODIS Land Products Subsets Web Services

License

NotificationsYou must be signed in to change notification settings

bluegreen-labs/MODISTools

Repository files navigation

R build statuscodecovStatusDownloadsDOI

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

Installation

stable release

To install the current stable release use a CRAN repository:

install.packages("MODISTools")library("MODISTools")

development release

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")

Use

Downloading MODIS time series

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)

ParameterDescription
producta MODIS product
banda MODIS product band (if NULL all bands are downloaded)
latlatitude of the site
lonlongitude of the site
startstart year of the time series (data start in 1980)
endend year of the time series (current year - 2 years, use force = TRUE to override)
internallogical, TRUE or FALSE, if true data is imported into R workspace otherwise it is downloaded into the current working directory
out_dirpath where to store the data when not used internally, defaults to tempdir()
km_lrforce “out of temporal range” downloads (integer)
km_absuppress the verbose output (integer)
site_namea site identifier
site_ida site_id for predefined locations (not required)
progresslogical, 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.

Batch downloading MODIS time series

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))

Listing products

To list all available products use the mt_products() function.

products<- mt_products()head(products)

Listing bands

To list all available bands for a given product use the mt_bands()function.

bands<- mt_bands(product="MOD11A2")head(bands)

listing dates

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)

References

Koen Hufkens. (2023). bluegreen-labs/MODISTools: MODISTools v1.1.5. Zenodo.https://doi.org/10.5281/zenodo.7551164

Acknowledgements

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

Stars

Watchers

Forks

Languages


[8]ページ先頭

©2009-2025 Movatter.jp