orgTime: Handle Input and Output Dates Used for Filtering

Description Usage Arguments Value Author(s) See Also Examples

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## S4 method for signature 'character'
orgTime(
  files,
  nDays = "asIn",
  begin = NULL,
  end = NULL,
  pillow = 75,
  pos1,
  pos2,
  format = "%Y%j"
)

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

## S4 method for signature '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):

Author(s)

Matteo Mattiuzzi, Florian Detsch

See Also

seq.Date.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# 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)

## End(Not run)

MODIS documentation built on Nov. 12, 2020, 5:06 p.m.