writeRasterxGEOtop: This function uses 'writeRaster' to create .asc maps which...

Description Usage Arguments Note Examples

View source: R/writeRasterxgeotop.R

Description

This function uses writeRaster to create .asc maps which can be read by GEOtop

Usage

1
2
3
writeRasterxGEOtop(x, filename = NULL, overwrite = TRUE, NAflag = -9999,
  use.decimal.formatter = FALSE, start.from.zero = FALSE, keyword, wpath,
  suffix.ext = ".asc", ...)

Arguments

x

a Raster object, see writeRaster. It can be also a RasterBrick-class object.

filename

see writeRaster. It is a vector of string or one string containing a decimal formatter (see brick.decimal.formatter) in case x is a RasterBrick-class object.

overwrite

logical. Default is TRUE, see writeRaster.

NAflag

numeric. Dafauli is -9999, see writeRaster.

use.decimal.formatter

logical value. Default is FALSE. If it is TRUE or x is a RasterBrick-class object with nlayers(x)!=length(filename) , filename is considered as one string containing a decimal formatter (e.g. "%04d", see brick.decimal.formatter). Otherwise, if filename is considered as a vector string.

start.from.zero

logical value. Default is FALSE. If TRUE the formatter starts from 0000, otherwise it starts from 0001.

keyword

geotop keyword to be used to extract the raster file name from geotop.inpts file. This is enabled if filename is equal to NULL.

wpath

simulation folder containing geotop.inpts file.

suffix.ext

charachter string to be added to the keyword value,e.g. possible suffix and extension of the raster file name. Default is ".asc".

...

further arguments of get.geotop.inpts.keyword.value or writeRaster

Note

It makes use of system functons. It uses *.asc format for raster files. In case the file name filename is missing and then NULL, it must be imported by the simulation geotop.inpts file.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
library(geotopbricks)

## Simulation working path

file <- system.file("rendena100/SnowDepthMapFile-2014-MA-mean-winter-2013-2014.asc",
package="geotopbricks")
snow <- raster(file)


snowfile <- "./temporary/snow.asc"

dir.create("./temporary")
writeRasterxGEOtop(x=snow,file=snowfile)

geotopbricks documentation built on May 29, 2017, 9:48 a.m.