rasterizeGimms: Rasterize GIMMS NDVI3g Data

Description Usage Arguments Value See Also Examples

View source: R/rasterizeGimms.R

Description

Import GIMMS NDVI3g (binary or NetCDF) data into R as Raster* objects.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
rasterizeGimms(
  x,
  ext = NULL,
  snap = "out",
  keep = NULL,
  split = FALSE,
  cores = 1L,
  filename = "",
  ...
)

Arguments

x

character. Vector of local filepaths. Note that product versions must not be mixed, i.e. 'x' should represent files originating from either NDVI3g.v1 or NDVI3g.v0 only.

ext

Extent, or any object from which an Extent can be extracted, see crop.

snap

character, defaults to "out". Other available options are "in" and "near", see crop.

keep

integer. Flag values of NDVI3g pixels to spare during quality control. Pixels with non-included flag values are set to NA. If not specified (i.e., NULL; default), quality control is skipped.

split

logical, defaults to FALSE. If TRUE, a list of RasterStack objects (of length(x)) is returned rather than a single RasterStack.

cores

integer. Number of cores for parallel computing.

filename

character. Optional output filename. If specified, this must be of the same length as 'x'.

...

Further arguments passed to writeRaster.

Value

If split = TRUE, a list of NDVI3g RasterStack objects corresponding to the files specified in 'x'; else a single NDVI3g RasterStack object.

See Also

crop, qualityControl, writeRaster.

Examples

 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
## Not run: 
tmp <- tempdir()

## Download NDVI3g.v1 sample data
gimms_files <- downloadGimms(x = as.Date("2000-01-01"),
                             y = as.Date("2000-12-31"),
                             dsn = tmp)

## Extent for clipping
shp <- getData("GADM", country = "DEU", level = 0, path = tmp)

## Rasterize without quality control
gimms_raster <- rasterizeGimms(x = gimms_files,
                               ext = shp) # clipping
plot(gimms_raster[[1]])
lines(shp)

## Rasterize with quality control
gimms_rasterq <- rasterizeGimms(x = gimms_files,
                                ext = shp, # clipping
                                keep = 0)  # quality control
plot(gimms_rasterq[[1]])
lines(shp)

## End(Not run)

gimms documentation built on July 30, 2021, 5:06 p.m.