Result masking

Share:

Description

Masks values with the spatial informations of a given grid.

Usage

1
result.extract.mask(mask.grid, values)

Arguments

mask.grid

The grid with the spatial informations which should be used for masking.

values

The values to mask (in same order as ‘mask.grid’).

Details

Masks values with the spatial informations of a given grid. Gridcells with NA value are masked in the resulting data.frame by setting them to ‘-9999’.

Value

A vector of masked values.

Author(s)

Daniel Doktor, Maximilian Lange

See Also

result.extract.main

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
26
27
28
29
30
31
  
  ## load preprocessed data
  data(dataFinal)
  ## load spatial information
  data(relatedGrid)

  ## set or load params
  params <- c(0, 0.058326, 0.109494, 0.039178, 
			-10.34, -0.89, 18.11,-10.03, 
			28.61, 44.49)

  ## apply model
  result <- pim.solve(params, dataFinal, model.no=11, 
			silent=FALSE, out2File=FALSE)
 
  ## resolve outlier information
  outliers <- result$outlier.bb + result$outlier.lc
  outliers.na <- which(is.na(outliers)==TRUE)
  outliers[outliers.na] <- rep(0, length(outliers.na))

  mask.grid <- relatedGrid

  ## extract valid modelled values
  values.model <- result.extract.sub(mask.grid=mask.grid, 
				result$doy.bb.pim, result$gk4.x, 
				result$gk4.y, outliers=outliers, 
				silent=FALSE, withOutliers=FALSE)$values

  ## mask result values with spatial informations of mask.grid
  values.model <- result.extract.mask(relatedGrid, 
				values.model)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.