MODIS (version 1.1.7)

orgTime: Handle Input and Output Dates Used for Filtering

Description

This function lets you define the period to be filtered, the output temporal resolution, and select the required data from your input 'files'.

Usage

# S4 method for character
orgTime(
  files,
  nDays = "asIn",
  begin = NULL,
  end = NULL,
  pillow = 75,
  pos1,
  pos2,
  format = "%Y%j"
)

# S4 method for Date orgTime(files, nDays = "asIn", begin = NULL, end = NULL, pillow = 75)

# S4 method for Raster orgTime( files, nDays = "asIn", begin = NULL, end = NULL, pillow = 75, pos1, pos2, format = "%Y%j" )

Arguments

files

A character, Date, or Raster* object. Typically MODIS filenames created e.g. from runGdal or runMrt, but any other filenames holding date information are supported as well. If a Raster* object is supplied, make sure to adjust 'pos1', 'pos2', and 'format' according to its layer names.

nDays

Time interval for output layers. Defaults to "asIn" that includes the exact input dates within the period selected using begin and end. Can also be nDays = "1 month" or "1 week", see seq.Date and Examples.

begin

character. Output begin date, defaults to the earliest input dataset.

end

character. Output end date, defaults to the latest input dataset. Note that the exact end date depends on begin and nDays.

pillow

integer. Number of days added to the beginning and end of a time series.

pos1, pos2, format

Arguments passed to extractDate.

Value

A list with the following slots (to be completed):

  • $inSeq

  • $outSeq

  • $inDoys

  • $inputLayerDates

  • $outputLayerDates

  • $call

See Also

seq.Date.

Examples

Run this code
# NOT RUN {
# Using MODIS files
files <- c("MOD13A2.A2010353.1_km_16_days_composite_day_of_the_year.tif",
           "MOD13A2.A2011001.1_km_16_days_composite_day_of_the_year.tif",
           "MYD13A2.A2010361.1_km_16_days_composite_day_of_the_year.tif",
           "MYD13A2.A2011009.1_km_16_days_composite_day_of_the_year.tif")

orgTime(files)
orgTime(files,nDays=2,begin="2010350",end="2011015")

# Using other files, e.g. from AVHRR GIMMS NDVI (Jul 1981 to Dec 1982)
# }
# NOT RUN {
library(gimms)

files.v1 <- system.file("extdata/inventory_ecv1.rds", package = "gimms")
files.v1 <- readRDS(files.v1)[1:3]
dates.v1 <- monthlyIndices(files.v1, timestamp = TRUE)

orgTime(dates.v1)
# }
# NOT RUN {
# }

Run the code above in your browser using DataCamp Workspace