getHdf.Rd 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. % Generated by roxygen2: do not edit by hand
  2. % Please edit documentation in R/getHdf.R
  3. \docType{methods}
  4. \name{getHdf}
  5. \alias{getHdf}
  6. \alias{getHdf,character-method}
  7. \alias{getHdf,missing-method}
  8. \title{Create or Update Local Subset of Online MODIS Data Pool}
  9. \usage{
  10. \S4method{getHdf}{character}(product, HdfName, begin = NULL, end = NULL,
  11. tileH = NULL, tileV = NULL, extent = NULL, collection = NULL,
  12. checkIntegrity = TRUE, forceDownload = TRUE, ...)
  13. \S4method{getHdf}{missing}(HdfName, checkIntegrity = TRUE, ...)
  14. }
  15. \arguments{
  16. \item{product}{\code{character}. MODIS grid product to be downloaded, see
  17. \code{\link{getProduct}}. Use dot notation to address Terra and Aqua products
  18. (e.g. \code{M.D13Q1}).}
  19. \item{HdfName}{\code{character} vector or \code{list}. Full HDF file name(s)
  20. to download a small set of files. If specified, other file-related parameters
  21. (i.e., \code{begin}, \code{end}, \code{collection}, etc.) are ignored.}
  22. \item{begin}{\code{character}. Begin date of MODIS time series, see
  23. \code{\link{transDate}} for formatting.}
  24. \item{end}{\code{character}. End date, compatible with future dates for
  25. continuous updates via scheduled jobs.}
  26. \item{tileH}{\code{numeric} or \code{character}. Horizontal tile number(s),
  27. see \code{\link{getTile}}.}
  28. \item{tileV}{\code{numeric} or \code{character}. Vertical tile number(s),
  29. see \code{tileH}.}
  30. \item{extent}{See Details in \code{\link{getTile}}.}
  31. \item{collection}{Desired MODIS product collection as \code{character},
  32. \code{integer}, or \code{list} as returned by \code{\link{getCollection}}.}
  33. \item{checkIntegrity}{\code{logical}. If \code{TRUE} (default), the size of
  34. each downloaded file is checked. In case of inconsistencies, the function
  35. tries to re-download broken files.}
  36. \item{forceDownload}{\code{logical}. If \code{TRUE} (default), try to
  37. download data irrespective of whether online information could be retrieved
  38. via \code{MODIS:::getStruc} or not.}
  39. \item{...}{Further arguments passed to \code{\link{MODISoptions}}, eg 'wait'.}
  40. }
  41. \value{
  42. An invisible vector of downloaded data and paths.
  43. }
  44. \description{
  45. Create or update a local user-defined subset of the global MODIS grid data
  46. archive. Based on user-specific parameters the function checks in the local
  47. archive for available data and downloads missing data from the online MODIS
  48. data pool. When run in a schedule job, the function manage the continuous
  49. update of the local MODIS data archive.
  50. }
  51. \examples{
  52. \dontrun{
  53. # One or more specific file (no regular erpression allowed here)
  54. a <- getHdf(HdfName = c("MYD11A1.A2009001.h18v04.006.2015363221538.hdf",
  55. "MYD11A1.A2009009.h18v04.006.2015364055036.hdf",
  56. "MYD11A1.A2009017.h18v04.006.2015364115403.hdf"))
  57. a
  58. # Get all MODIS Terra and Aqua M*D11A1 data from 1 December 2016 up to today
  59. # (can be ran in a sceduled job for daily archive update)
  60. b1 <- getHdf(product = "M.D11A1", begin = "2016.12.01",
  61. tileH = 18:19, tileV = 4)
  62. b1
  63. # Same tiles with a 'list' extent
  64. Austria <- list(xmax = 17.47, xmin = 9.2, ymin = 46.12, ymax = 49.3)
  65. b2 <- getHdf(product = "M.D11A1", begin = "2016336", extent = Austria)
  66. b2
  67. # Using country boarders from 'mapdata' package
  68. c <- getHdf(product = "M.D11A1", begin = "2016306", end = "2016335",
  69. extent = "Luxembourg")
  70. c
  71. # Interactive selection of spatial extent, see getTile()
  72. d <- getHdf(product = "M.D11A1", begin = "2016306", end = "2016307")
  73. d
  74. }
  75. }
  76. \references{
  77. MODIS data is obtained through the online Data Pool at the NASA Land
  78. Processes Distributed Active Archive Center (LP DAAC), USGS/Earth Resources
  79. Observation and Science (EROS) Center, Sioux Falls, South Dakota
  80. \url{https://lpdaac.usgs.gov/get_data}.
  81. }
  82. \author{
  83. Matteo Mattiuzzi
  84. }