orgTime.Rd 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. % Generated by roxygen2: do not edit by hand
  2. % Please edit documentation in R/orgTime.R
  3. \docType{methods}
  4. \name{orgTime}
  5. \alias{orgTime}
  6. \alias{orgTime,character-method}
  7. \alias{orgTime,Date-method}
  8. \alias{orgTime,Raster-method}
  9. \title{Handle Input and Output Dates Used for Filtering}
  10. \usage{
  11. \S4method{orgTime}{character}(files, nDays = "asIn", begin = NULL,
  12. end = NULL, pillow = 75, pos1, pos2, format = "\%Y\%j")
  13. \S4method{orgTime}{Date}(files, nDays = "asIn", begin = NULL, end = NULL,
  14. pillow = 75)
  15. \S4method{orgTime}{Raster}(files, nDays = "asIn", begin = NULL,
  16. end = NULL, pillow = 75, pos1, pos2, format = "\%Y\%j")
  17. }
  18. \arguments{
  19. \item{files}{A \code{character}, \code{Date}, or \code{Raster*} object.
  20. Typically MODIS filenames created e.g. from \code{\link{runGdal}} or
  21. \code{\link{runMrt}}, but any other filenames holding date information are
  22. supported as well. If a \code{Raster*} object is supplied, make sure to
  23. adjust 'pos1', 'pos2', and 'format' according to its layer
  24. \code{\link[raster]{names}}.}
  25. \item{nDays}{Time interval for output layers. Defaults to \code{"asIn"} that
  26. includes the exact input dates within the period selected using \code{begin}
  27. and \code{end}. Can also be \code{nDays = "1 month"} or \code{"1 week"}, see
  28. \code{\link{seq.Date}} and Examples.}
  29. \item{begin}{\code{character}. Output begin date, defaults to the earliest
  30. input dataset.}
  31. \item{end}{\code{character}. Output end date, defaults to the latest input
  32. dataset. Note that the exact \code{end} date depends on \code{begin} and
  33. \code{nDays}.}
  34. \item{pillow}{\code{integer}. Number of days added to the beginning and end
  35. of a time series.}
  36. \item{pos1, pos2, format}{Arguments passed to \code{\link{extractDate}}.}
  37. }
  38. \value{
  39. A \code{list} with the following slots (to be completed):
  40. \itemize{
  41. \item{\code{$inSeq}}
  42. \item{\code{$outSeq}}
  43. \item{\code{$inDoys}}
  44. \item{\code{$inputLayerDates}}
  45. \item{\code{$outputLayerDates}}
  46. \item{\code{$call}}
  47. }
  48. }
  49. \description{
  50. This function lets you define the period to be filtered, the output temporal
  51. resolution, and select the required data from your input 'files'.
  52. }
  53. \examples{
  54. # Using MODIS files
  55. files <- c("MOD13A2.A2010353.1_km_16_days_composite_day_of_the_year.tif",
  56. "MOD13A2.A2011001.1_km_16_days_composite_day_of_the_year.tif",
  57. "MYD13A2.A2010361.1_km_16_days_composite_day_of_the_year.tif",
  58. "MYD13A2.A2011009.1_km_16_days_composite_day_of_the_year.tif")
  59. orgTime(files)
  60. orgTime(files,nDays=2,begin="2010350",end="2011015")
  61. \dontrun{
  62. # Using other files, e.g. from GIMMS (Jul 1981 to Dec 1982)
  63. library(gimms)
  64. files.v1 <- system.file("extdata/inventory_ecv1.rds", package = "gimms")
  65. files.v1 <- readRDS(files.v1)[1:3]
  66. dates.v1 <- monthlyIndices(files.v1, timestamp = TRUE)
  67. orgTime(dates.v1)
  68. }
  69. }
  70. \seealso{
  71. \code{\link{seq.Date}}.
  72. }
  73. \author{
  74. Matteo Mattiuzzi, Florian Detsch
  75. }