Learn R Programming

geotopbricks (version 1.3.3)

get.geotop.inpts.keyword.value: Returns the values of a keyword of "geotop.inpts" file or data frame with the suitable format

Description

Returns the values of a keyword of "geotop.inpts" file or data frame with the suitable format

Usage

get.geotop.inpts.keyword.value(keyword,
    inpts.frame = NULL, vector_sep = NULL, numeric = FALSE,
    format = "%d/%m/%Y %H:%M", date = FALSE, tz = "A",
    raster = FALSE, file_extension = ".asc",
    add_wpath = FALSE, wpath = NULL,
    use.read.raster.from.url = TRUE, data.frame = FALSE,
    formatter = "%04d", level = 1, date_field = "Date",
    isNA = -9999, matlab.syntax = TRUE,
    projfile = "geotop.proj", ...)

Arguments

keyword
keyword name
inpts.frame
data frame returned by declared.geotop.inpts.keywords or NULL. Default is NULL.
vector_sep
character value for the separator chacter if Keyword Value must be returned as a vector, otherwise it is NULL. Default is NULL, but if numeric or date are FALSE, vactor_sep
numeric
logical value. If TRUE the Value has numeric type, otherwise it is a string or string vector. Default is FALSE.
date
logical value. If TRUE the Value is retured as POSIXlt date, otherwise it is a string or string vector. Default is FALSE.
format
string format representing the date, see as.POSIXlt, used if date is TRUE. Default is "%d/%m/%Y %H:%M" (which is the format used in geotop.inpts
tz
format string representing the time zone, see as.POSIXlt, used if date is TRUE. Default is "A".
raster
logical value. Default is FALSE. If TRUE function returns direclty the raster map as Raster-class object built with raster
file_extension
Extension to be added to the keyword if keyword is a file name. Default is ".asc"
wpath
working directory containing GEOtop files (included the inpts file), see declared.geotop.inpts.keywords. It is mandatory if raster is TRUE.
add_wpath
logical value. Default is FALSE. If TRUE, the wpath string is attached to the keyword string value. It is automatically set TRUE if raster is TRUE.
use.read.raster.from.url
logical value. Default is TRUE. If TRUE the RasterLayer are read with read.raster.from.url, istead of raster (oth
data.frame
logical value. It is an option for tabular data. If TRUE function returns direclty a data frame or a list of data frames as data.frame or zoo
formatter
string value. It is the decimal formatter contained in the file name and used in case the tabular data are referred at several points. Default is "%04d" . It is used in case data.frame is TRUE.
level
integer values. Numbers incating all the identandification numbers of the files containing the requested data frames. Default is 1, correspondig to the decimal formatter "0001". See examples.
date_field
string value. Default is "Date", otherwise defined by the value of HeaderDateDDMMYYYYhhmmMeteo geotop keyword. It is used only if the argument data.frame is TRUE. If it is NULL or NA
isNA
numeric value indicating NA in geotop ascii files. Default is -9999.00
matlab.syntax
logical value. Default is FALSE. If TRUE a vector is written in a string according to *.m file syntax. Warning: this synstax is not read by GEOtop.
projfile
fileneme of the GEOtop projection file. Default is geotop.proj.
...
further arguments of declared.geotop.inpts.keywords

Value

  • the keyword value

Examples

Run this code
library(geotopbricks)

#Simulation working path
wpath <- 'http://meteogis.fmach.it/idroclima/panola13_run2xC_test3'
prefix <- get.geotop.inpts.keyword.value("SoilLiqWaterPressTensorFile",wpath=wpath)

slope <- get.geotop.inpts.keyword.value("SlopeMapFile",raster=TRUE,wpath=wpath)
bedrock_depth <- get.geotop.inpts.keyword.value("BedrockDepthMapFile",raster=TRUE,wpath=wpath)

layers <- get.geotop.inpts.keyword.value("SoilLayerThicknesses",numeric=TRUE,wpath=wpath)
names(layers) <- paste("L",1:length(layers),sep="")

# set van genuchten parameters to estimate water volume
theta_sat <- get.geotop.inpts.keyword.value("ThetaSat",numeric=TRUE,wpath=wpath)
theta_res <- get.geotop.inpts.keyword.value("ThetaRes",numeric=TRUE,wpath=wpath)
alphaVG <-  get.geotop.inpts.keyword.value("AlphaVanGenuchten",
numeric=TRUE,wpath=wpath) # expressed in mm^-1

nVG <-  get.geotop.inpts.keyword.value("NVanGenuchten",numeric=TRUE,wpath=wpath)


# end set van genuchten parameters to estimate water volume


# set time during wich GEEOtop simulation provided maps (the script is written for daily frequency")

start <-  get.geotop.inpts.keyword.value("InitDateDDMMYYYYhhmm",date=TRUE,wpath=wpath,tz="A")
end <- get.geotop.inpts.keyword.value("EndDateDDMMYYYYhhmm",date=TRUE,wpath=wpath,tz="A")

nmeteo <- get.geotop.inpts.keyword.value("NumberOfMeteoStations",numeric=TRUE,wpath=wpath)
level <- 1:nmeteo
meteo <- get.geotop.inpts.keyword.value("MeteoFile",wpath=wpath,data.frame=TRUE,level=level)

# end set time during wich GEOtop simulation provided maps
# (the script is written for daily frequency")

Run the code above in your browser using DataLab