Title: | An R Plug-in for the Distributed Hydrological Model GEOtop |
---|---|
Description: | It analyzes raster maps and other information as input/output files from the Hydrological Distributed Model GEOtop. It contains functions and methods to import maps and other keywords from geotop.inpts file. Some examples with simulation cases of GEOtop 2.x/3.x are presented in the package. Any information about the GEOtop Distributed Hydrological Model source code is available on www.geotop.org. Technical details about the model are available in Endrizzi et al (2014) <https://gmd.copernicus.org/articles/7/2831/2014/gmd-7-2831-2014.html>. |
Authors: | Emanuele Cordano |
Maintainer: | Emanuele Cordano <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.5.8.2 |
Built: | 2024-11-11 04:45:02 UTC |
Source: | https://github.com/ecor/geotopbricks |
This command parses ...DESCRITION TO DO !!!
argsParser(option, args, sep = " ", novalue_response = NULL)
argsParser(option, args, sep = " ", novalue_response = NULL)
option |
character strings containg options (or flag) whose values |
args |
String containing all the arguments of an R script |
sep |
separator character. Default is |
novalue_response |
value used in case the option is missing. Default is |
args <- "--value 6 --fruit apple" option <- "--fruit" value <- argsParser(option=option,args=args) option2 <- "--jobs" value2 <- argsParser(option=option2,args=args) value22 <- argsParser(option=option2,args=args,novalue_response="./") args_b <- "value=6 , fruit=apple" option3 <- "value" value <- argsParser(option=option3,args=args_b,sep=c(",","="))
args <- "--value 6 --fruit apple" option <- "--fruit" value <- argsParser(option=option,args=args) option2 <- "--jobs" value2 <- argsParser(option=option2,args=args) value22 <- argsParser(option=option2,args=args,novalue_response="./") args_b <- "value=6 , fruit=apple" option3 <- "value" value <- argsParser(option=option3,args=args_b,sep=c(",","="))
It contains hourly meteorological data observed at MeteoTrentino T0327
station located at Monte Bondone-Viotte (Trentino, Easter Alps, Italy) from August 2004 to December 2012.\
The zoo
object 'meteo' contains:
Iprec
Hourly Precipitation Depth expressed in millimeters
AirT
Air Temperature expressed in Celsius Degree
RH
Relative Humidity in PerCent
WinDir
Wind Direction expressed in Degrees North Clockwise
WinSp
Wind Direction expressed in meters per second
Swglob
Short-Wave Radiation expressed in Watts per square meters
The corresponding time axis vector for each observation can be printed by typing index(meteo)
.
data(bondone)
data(bondone)
Data frame , 'zoo' object
This data set stores all meteorological information useful for a GEOtop simulation. The user can easily use the package with his/her own data after replacing the values of such variables.
Original data are provided by Provincia Autonoma di Trento (https://www.meteotrentino.it/)).
This dataset is intended for research purposes only, being distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.
Added implemetation for 'brick' S4 method
@title brick
## S4 method for signature 'zoo' brick( x, layer = 1, timerange = NULL, time = NULL, rows = 1:nrow(x), crs = NULL, use.read.raster.from.url = TRUE ) ## S4 method for signature 'GeotopRasterBrick' brick(x)
## S4 method for signature 'zoo' brick( x, layer = 1, timerange = NULL, time = NULL, rows = 1:nrow(x), crs = NULL, use.read.raster.from.url = TRUE ) ## S4 method for signature 'GeotopRasterBrick' brick(x)
x |
a 'zoo' object returned by function |
layer |
layer at which raster maps are imported. If is |
timerange |
two-elememts vector containing the time range at which geotop maps are imported |
time |
vector of time instants at which geotop maps are imported |
rows |
rows of |
crs |
coordinate system see |
use.read.raster.from.url |
logical value. Default is |
a RasterBrick-class
containing the geopop maps indicated by x
, which is already in a GeotopRasterBrick-class
object or a 'zoo' object returned by function pointer.to.maps.xyz.time
or pointer.to.maps.xy.time
.
getvalues.brick.at.depth
,vertical.aggregate.brick.within.depth
# TON TOSS # See the examples in the functions listed in the 'SeeAlso' section
# TON TOSS # See the examples in the functions listed in the 'SeeAlso' section
Imports a brick of raster ascii maps into a 'brick' object
brick.decimal.formatter( file = NULL, file_prefix, formatter = "%04d", file_extension = ".asc", nlayers = 10, use.read.raster.from.url = FALSE, crs = NULL, start.from.zero = FALSE )
brick.decimal.formatter( file = NULL, file_prefix, formatter = "%04d", file_extension = ".asc", nlayers = 10, use.read.raster.from.url = FALSE, crs = NULL, start.from.zero = FALSE )
file |
fileneme of the 'brick' files containing the decimal formatter. It is |
file_prefix |
character string suffix name of the 'brick' files. |
formatter |
string value. Default is |
file_extension |
strinf value. Default is |
nlayers |
number of layers |
use.read.raster.from.url |
logical value. Default is |
crs |
coordinate system see |
start.from.zero |
logical value. Default is |
the output is returned as a RasterBrick-class
object
library(geotopbricks) library(raster) file <- system.file("example_files/examples/snowthickness",package="geotopbricks") file <- paste(file,"SnowThickness0000L%04d.asc",sep="/") # nlayers=15 nlayers <- 6 ## Only 6 layers are read to minimize the elapsed time of the example!! b <- brick.decimal.formatter(file=file,nlayers=nlayers) nlayers(b) names(b)
library(geotopbricks) library(raster) file <- system.file("example_files/examples/snowthickness",package="geotopbricks") file <- paste(file,"SnowThickness0000L%04d.asc",sep="/") # nlayers=15 nlayers <- 6 ## Only 6 layers are read to minimize the elapsed time of the example!! b <- brick.decimal.formatter(file=file,nlayers=nlayers) nlayers(b) names(b)
Extracts a brick or a raster layer from a output 3D Tensor or 2D map respectively
brickFromOutputSoil3DTensor( x, when, layers = "SoilLayerThicknesses", one.layer = FALSE, suffix = "L%04dN%04d.asc", time_formatter = "N%04d", suffix_one.layer = "N%04d.asc", wpath = NULL, tz = "A", start_date_key = "InitDateDDMMYYYYhhmm", end_date_key = "EndDateDDMMYYYYhhmm", timestep = "OutputSoilMaps", use.read.raster.from.url = FALSE, crs = NULL, projfile = "geotop.proj", start.from.zero = FALSE, secondary.suffix = NULL, only.map.filename = FALSE, add_suffix_dir = NULL, ... ) rasterFromOutput2DMap(x, when, ...)
brickFromOutputSoil3DTensor( x, when, layers = "SoilLayerThicknesses", one.layer = FALSE, suffix = "L%04dN%04d.asc", time_formatter = "N%04d", suffix_one.layer = "N%04d.asc", wpath = NULL, tz = "A", start_date_key = "InitDateDDMMYYYYhhmm", end_date_key = "EndDateDDMMYYYYhhmm", timestep = "OutputSoilMaps", use.read.raster.from.url = FALSE, crs = NULL, projfile = "geotop.proj", start.from.zero = FALSE, secondary.suffix = NULL, only.map.filename = FALSE, add_suffix_dir = NULL, ... ) rasterFromOutput2DMap(x, when, ...)
x |
string. GEOtop keyword reletated to the 3D or 2D variable to be imported in R. |
when |
|
layers |
number of soil layer or geotop keyword for soil layer (e.g. |
one.layer |
logical value. If |
suffix |
charachter string containing the decimal formatter used by GEOtop in the output file names. Default is |
time_formatter , suffix_one.layer
|
charachter string ( |
wpath , tz , use.read.raster.from.url
|
|
start_date_key , end_date_key
|
initial and final detes and times of the GEOtop simulation or alternatively the respective keywords of |
timestep |
time step expressed in seconds every which the raster file has been created. It can be a string corresponding to the geotop keyword in the inpts file. Default value is |
crs , start.from.zero
|
see |
projfile |
name of the |
secondary.suffix |
String secondary suffix which can be added at the end of the Map file name (optional). Default is |
only.map.filename |
logical value. If it is |
add_suffix_dir , ...
|
additional arguments for |
These functions brickFromOutputSoil3DTensor
and rasterFromOutput2DMap
return 3D or 2D Raster-class
objects respectively. rasterFromOutput2DMap
is a wrapper function of brickFromOutputSoil3DTensor
with the option one.layer==TRUE
.
The functionswork with the following output keywords:
"SoilTempTensorFile"
,
"SoilAveragedTempTensorFile"
,
"SoilLiqContentTensorFile"
,
"SoilAveragedLiqContentTensorFile"
,
"SoilIceContentTensorFile"
,
"SoilAveragedIceContentTensorFile"
,
"SoilLiqWaterPressTensorFile"
,
"SoilTotWaterPressTensorFile"
for brickFromOutputSoil3DTensor
;
"FirstSoilLayerTempMapFile"
,
"FirstSoilLayerAveragedTempMapFile"
,
"FirstSoilLayerLiqContentMapFile"
,
"FirstSoilLayerIceContentMapFile"
,
"LandSurfaceWaterDepthMapFile"
,
"ChannelSurfaceWaterDepthMapFile"
,
"NetRadiationMapFile"
,
"InLongwaveRadiationMapFile"
,
"NetLongwaveRadiationMapFile"
,
"NetShortwaveRadiationMapFile"
,
"InShortwaveRadiationMapFile"
,
"DirectInShortwaveRadiationMapFile"
,
"ShadowFractionTimeMapFile"
,
"SurfaceHeatFluxMapFile"
,
"SurfaceSensibleHeatFluxMapFile"
,
"SurfaceLatentHeatFluxMapFile"
,
"SurfaceTempMapFile"
,
"PrecipitationMapFile"
,
"CanopyInterceptedWaterMapFile"
,
"SnowDepthMapFile"
,
"GlacierDepthMapFile"
,
"SnowMeltedMapFile"
,
"SnowSublMapFile"
,
"GlacierMeltedMapFile"
,
"GlacierSublimatedMapFile"
,
"AirTempMapFile"
,
"WindSpeedMapFile"
,
"WindDirMapFile"
,
"RelHumMapFiladd_suffix_dir=NULLe"
,
"SWEMapFile"
,
"GlacierWaterEqMapFile"
"SnowDurationMapFile"
,
"ThawedSoilDepthMapFile"
,
"ThawedSoilDepthFromAboveMapFile"
,
"WaterTableDepthMapFile"
,
"WaterTableDepthFromAboveMapFile"
,
"NetPrecipitationMapFile"
,
"EvapotranspirationFromSoilMapFile"
for rasterFromOutput2DMap
.
Emanuele Cordano
get.geotop.inpts.keyword.value
,brick.decimal.formatter
library(geotopbricks) ## Not run: # The data containing in the link are only for educational use wpath <- 'https://raw.githubusercontent.com/ecor/geotopbricks_doc/master/simulations/idroclim_test1' ## URL path (RAW VERSION) of ## https://github.com/ecor/geotopbricks_doc/tree/master/simulations/idroclim_test1 x <- "SoilLiqContentTensorFile" tz <- "Etc/GMT-1" when <- as.POSIXct("2002-03-22",tz=tz) # Not Run because it elapses too long time!!! # Please Uncomment the following lines to run by yourself!!! b <- brickFromOutputSoil3DTensor(x,when=when,wpath=wpath,tz=tz,use.read.raster.from.url=TRUE) # a 2D map: x_e <- "SnowDepthMapFile" # Not Run: uncomment the following line m <- rasterFromOutput2DMap(x_e,when=when,wpath=wpath,timestep="OutputSnowMaps", tz=tz,use.read.raster.from.url=TRUE) ## NOTE: set use.read.raster.from.url=FALSE (default) # if the "wpath" directorty is in the local file system. # Not Run: uncomment the following line plot(m) ## End(Not run)
library(geotopbricks) ## Not run: # The data containing in the link are only for educational use wpath <- 'https://raw.githubusercontent.com/ecor/geotopbricks_doc/master/simulations/idroclim_test1' ## URL path (RAW VERSION) of ## https://github.com/ecor/geotopbricks_doc/tree/master/simulations/idroclim_test1 x <- "SoilLiqContentTensorFile" tz <- "Etc/GMT-1" when <- as.POSIXct("2002-03-22",tz=tz) # Not Run because it elapses too long time!!! # Please Uncomment the following lines to run by yourself!!! b <- brickFromOutputSoil3DTensor(x,when=when,wpath=wpath,tz=tz,use.read.raster.from.url=TRUE) # a 2D map: x_e <- "SnowDepthMapFile" # Not Run: uncomment the following line m <- rasterFromOutput2DMap(x_e,when=when,wpath=wpath,timestep="OutputSnowMaps", tz=tz,use.read.raster.from.url=TRUE) ## NOTE: set use.read.raster.from.url=FALSE (default) # if the "wpath" directorty is in the local file system. # Not Run: uncomment the following line plot(m) ## End(Not run)
declared.geotop.inpts.keywords
Creates an 'geotop.inpts' files the keyword and their values of a date.frame like the one returned by declared.geotop.inpts.keywords
create.geotop.inpts.keyword( df, file = "geotop.inpts.copy", wpath = NULL, comment.lines = "default", header = "default", ... )
create.geotop.inpts.keyword( df, file = "geotop.inpts.copy", wpath = NULL, comment.lines = "default", header = "default", ... )
df |
data frame returend by |
file |
connetion or file name where to write 'df' |
wpath |
complere path to |
comment.lines |
string or vector of strings to add as comments for each keyword. If it is |
header |
string or vector of strings to add as a header. If it is |
... |
further arguments for |
In case comment.lines
and header
are set equal to "default"
,
they are suitably modified within the function code.
See the example output.
writeLines
,declared.geotop.inpts.keywords
library(geotopbricks) ## Not run: #Simulation working path wpath <- 'https://raw.githubusercontent.com/ecor/geotopbricks_doc/master/simulations/panola13_run2xC_test3' ## URL path (RAW VERSION) of ## https://github.com/ecor/geotopbricks_doc/tree/master/simulations/panola13_run2xC_test3 df <- declared.geotop.inpts.keywords(wpath=wpath) create.geotop.inpts.keyword(df=df) ## End(Not run)
library(geotopbricks) ## Not run: #Simulation working path wpath <- 'https://raw.githubusercontent.com/ecor/geotopbricks_doc/master/simulations/panola13_run2xC_test3' ## URL path (RAW VERSION) of ## https://github.com/ecor/geotopbricks_doc/tree/master/simulations/panola13_run2xC_test3 df <- declared.geotop.inpts.keywords(wpath=wpath) create.geotop.inpts.keyword(df=df) ## End(Not run)
Creates geotop meteo files from (a list of) 'zoo' objects
create.geotop.meteo.files( x, format = "%d/%m/%Y %H:%M", file_prefix = "meteo", file_extension = ".txt", formatter = "%04d", na = "-9999", col.names = TRUE, row.names = FALSE, date_field = "Date", sep = ",", level = NULL, quote = FALSE, ... )
create.geotop.meteo.files( x, format = "%d/%m/%Y %H:%M", file_prefix = "meteo", file_extension = ".txt", formatter = "%04d", na = "-9999", col.names = TRUE, row.names = FALSE, date_field = "Date", sep = ",", level = NULL, quote = FALSE, ... )
x |
'zoo' object or a list of 'zoo' object representing the meteorological station |
format |
string format representing the date, see |
file_prefix |
string containing file prefix (full path). It correspos to the value of in |
file_extension |
string containing the extensions of final files. Default is |
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 |
na |
NA value indicator. Default is |
col.names |
logical parameter. Default is |
row.names |
logical parameter. Default is |
date_field |
string value. Default is "Date", otherwise defined by the value of |
sep |
string value. Default is |
level |
integer argument. See |
quote |
logical parameter. Default is |
... |
further arguments for |
write.table
,get.geotop.inpts.keyword.value
library(geotopbricks) data(bondone) ## It contains a "meteo" zoo object. set.seed(12) file_prefix <- paste(tempdir(),"meteo",sep="/") level=2 out <- create.geotop.meteo.files(x=meteo,file_prefix=file_prefix,level=level) ## It exports the "meteo" zoo object into a ASCII file for GEOtop head(readLines(out)) out
library(geotopbricks) data(bondone) ## It contains a "meteo" zoo object. set.seed(12) file_prefix <- paste(tempdir(),"meteo",sep="/") level=2 out <- create.geotop.meteo.files(x=meteo,file_prefix=file_prefix,level=level) ## It exports the "meteo" zoo object into a ASCII file for GEOtop head(readLines(out)) out
Collects all keywords contained in the 'getop.inpts' configuration files and their values in a data frame object.
declared.geotop.inpts.keywords( wpath, inpts.file = "geotop.inpts", comment = "!", exceptions = "Date", warn = FALSE, no.comment = c("!>!", "!>>!"), ... )
declared.geotop.inpts.keywords( wpath, inpts.file = "geotop.inpts", comment = "!", exceptions = "Date", warn = FALSE, no.comment = c("!>!", "!>>!"), ... )
wpath |
working directory containing GEOtop files |
inpts.file |
name of the GEOtop configuration file. Default is |
comment |
comment indicator charcater. Default is |
exceptions |
string vector. If keywords contain an element of this vector, the blank spaces in Value |
warn |
logical argument of |
no.comment |
string indicatos read as comment ones by GEOtop but they do not indicate comments by "geotopbricks" package. |
... |
further arguments of |
a data frame with two columns: Keyword
and Value
get.geotop.inpts.keyword.value
geotopbrick method bla bla bla
geotopbrick(x = NULL, ...) ## Default S3 method: geotopbrick(x, ...) ## S3 method for class 'zoo' geotopbrick(x, layer = NULL, time = NULL, crs = NULL, timerange = NULL, ...) ## S3 method for class 'RasterLayer' geotopbrick(x, layer = NULL, time = NULL, ascpath = zoo(NULL), ...) ## S3 method for class 'RasterBrick' geotopbrick(x, layer = NULL, time = NULL, ascpath = zoo(NULL), ...) ## S3 method for class 'GeotopRasterBrick' geotopbrick( x, layer = NULL, time = NULL, crs = NULL, timerange = NULL, ascpath = NULL, ... )
geotopbrick(x = NULL, ...) ## Default S3 method: geotopbrick(x, ...) ## S3 method for class 'zoo' geotopbrick(x, layer = NULL, time = NULL, crs = NULL, timerange = NULL, ...) ## S3 method for class 'RasterLayer' geotopbrick(x, layer = NULL, time = NULL, ascpath = zoo(NULL), ...) ## S3 method for class 'RasterBrick' geotopbrick(x, layer = NULL, time = NULL, ascpath = zoo(NULL), ...) ## S3 method for class 'GeotopRasterBrick' geotopbrick( x, layer = NULL, time = NULL, crs = NULL, timerange = NULL, ascpath = NULL, ... )
x |
a 'zoo' object returned by function |
... |
further arguments. |
layer |
layer at which raster maps are imported. If is |
time |
vector of time instants at which geotop maps are imported |
crs |
coordinate system see |
timerange |
two-elememts vector containing the time range at which geotop maps are imported |
ascpath |
|
A GeotopRasterBrick: an object to manage raster maps provied by GEOtop!!
ascpath
:A "zoo"
S3 object containing the names of ascii maps provided by GEOtop
index
:A "POSIXt"
S3 object containing time or dates on which raster layers of brick
are referred
layer
:character. Name of the vertical layer at which raster map are referred
brick
:A "RasterBrick-class"
S4 object containing the Raster-Layer maps imported from GEOtop output files
#' @note A GeotopRasterBrick
object can be created by new("GeotopRasterBrick", ...)
Emanuele Cordano
showClass("GeotopRasterBrick")
showClass("GeotopRasterBrick")
It returns the values of a keyword of "geotop.inpts" file or data frame with the suitable format.
get.geotop.inpts.keyword.value( keyword, inpts.frame = NULL, vector_sep = NULL, col_sep = ",", numeric = FALSE, format = "%d/%m/%Y %H:%M", date = FALSE, tz = "Etc/GMT-1", 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", start_date = NULL, end_date = NULL, ContinuousRecovery = 0, ContinuousRecoveryFormatter = "_crec%04d", zlayer.formatter = NULL, z_unit = c("centimeters", "millimeters"), geotop_z_unit = "millimeters", add_suffix_dir = NULL, MAXNROW = 4, header.only = FALSE, ... )
get.geotop.inpts.keyword.value( keyword, inpts.frame = NULL, vector_sep = NULL, col_sep = ",", numeric = FALSE, format = "%d/%m/%Y %H:%M", date = FALSE, tz = "Etc/GMT-1", 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", start_date = NULL, end_date = NULL, ContinuousRecovery = 0, ContinuousRecoveryFormatter = "_crec%04d", zlayer.formatter = NULL, z_unit = c("centimeters", "millimeters"), geotop_z_unit = "millimeters", add_suffix_dir = NULL, MAXNROW = 4, header.only = FALSE, ... )
keyword |
keyword name |
inpts.frame |
data frame returned by |
vector_sep |
character value for the separator character if Keyword Value must be returned as a vector, otherwise it is |
col_sep |
character value for the separator character of columuns. It is used if Keyword Value is returned as a data frema or zoo object or list of these objects. Default is |
numeric |
logical value. If |
format |
string format representing the date, see |
date |
logical value. If |
tz |
format string representing the time zone, see |
raster |
logical value. Default is |
file_extension |
Extension to be added to the keyword if keyword is a file name. Default is |
add_wpath |
logical value. Default is |
wpath |
working directory containing GEOtop files (included the inpts file). It is mandatory if |
use.read.raster.from.url |
logical value. Default is |
data.frame |
logical value. It is an option for tabular data. If |
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 |
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 |
date_field |
string value. Default is "Date", otherwise defined by the value of |
isNA |
numeric value indicating NA in geotop ascii files. Default is -9999.00 |
matlab.syntax |
logical value. Default is |
projfile |
fileneme of the GEOtop projection file. Default is |
start_date , end_date
|
null objects or dates in |
ContinuousRecovery |
integer value. Default is 0. It is used for tabular output data and is the number of times GEOtop simulation broke during its running and was re-launched with 'Contiuous Recovery' option. |
ContinuousRecoveryFormatter |
character string. Default is |
zlayer.formatter |
decimal formatter. It is used if |
z_unit |
z coordinate measurement unit. GEOtop values expressed in millimeters which are converted to centimeters by default. Default is |
geotop_z_unit |
z coordinate measurement unit used by GEOtop. Default is |
add_suffix_dir |
character string. Add a suffix at the directory reported in the keyword value |
MAXNROW |
maximum number accepted for |
header.only |
logical value. Default is |
... |
further arguments of |
the keyword value
If inpts.frame
is NULL
, inpts.frame
will be obtained by calling the function declared.geotop.inpts.keywords
with ...
arguments.
library(geotopbricks) #Simulation working path wpath <- 'https://raw.githubusercontent.com/ecor/geotopbricks_doc/master/simulations/panola13_run2xC_test3' ## URL path (RAW VERSION) of ## https://github.com/ecor/geotopbricks_doc/tree/master/simulations/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 meteo data tz <- "Etc/GMT-1" ## See help(timezones) In particular: ## Most platforms support time zones of the form Etc/GMT+n ## and Etc/GMT-n (possibly also without prefix Etc/), ## which assume a fixed offset from UTC (hence no DST). ## Contrary to some expectations ## (but consistent with names such as PST8PDT), negative offsets are times ahead of (east of) UTC, ## positive offsets are times behind (west of) UTC. start <- get.geotop.inpts.keyword.value("InitDateDDMMYYYYhhmm", date=TRUE,wpath=wpath,tz=tz) end <- get.geotop.inpts.keyword.value("EndDateDDMMYYYYhhmm", date=TRUE,wpath=wpath,tz=tz) nmeteo <- get.geotop.inpts.keyword.value("NumberOfMeteoStations", numeric=TRUE,wpath=wpath) level <- 1:nmeteo ## set meteo data meteo <- get.geotop.inpts.keyword.value("MeteoFile",wpath=wpath,data.frame=TRUE, level=level,start_date=start,end_date=end,tz=tz) ##### end set meteo data ## IMPORTING AN OUTPUT SOIL MOISTURE PROFILE: wpath <- paste0( 'https://raw.githubusercontent.com/ecor/geotopbricks_doc/', 'master/simulations/Muntatschini_pnt_1_225_B2_004') ## URL Path (RAW VERSION) of ## https://github.com/ecor/geotopbricks_doc/tree/master/simulations/Muntatschini_pnt_1_225_B2_004 SMC <- get.geotop.inpts.keyword.value("SoilLiqContentProfileFile", wpath=wpath,data.frame=TRUE,date_field="Date12.DDMMYYYYhhmm.", formatter="%04d") SMCz <- get.geotop.inpts.keyword.value("SoilLiqContentProfileFile", wpath=wpath,data.frame=TRUE,date_field="Date12.DDMMYYYYhhmm.", formatter="%04d",zlayer.formatter="z%04d")
library(geotopbricks) #Simulation working path wpath <- 'https://raw.githubusercontent.com/ecor/geotopbricks_doc/master/simulations/panola13_run2xC_test3' ## URL path (RAW VERSION) of ## https://github.com/ecor/geotopbricks_doc/tree/master/simulations/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 meteo data tz <- "Etc/GMT-1" ## See help(timezones) In particular: ## Most platforms support time zones of the form Etc/GMT+n ## and Etc/GMT-n (possibly also without prefix Etc/), ## which assume a fixed offset from UTC (hence no DST). ## Contrary to some expectations ## (but consistent with names such as PST8PDT), negative offsets are times ahead of (east of) UTC, ## positive offsets are times behind (west of) UTC. start <- get.geotop.inpts.keyword.value("InitDateDDMMYYYYhhmm", date=TRUE,wpath=wpath,tz=tz) end <- get.geotop.inpts.keyword.value("EndDateDDMMYYYYhhmm", date=TRUE,wpath=wpath,tz=tz) nmeteo <- get.geotop.inpts.keyword.value("NumberOfMeteoStations", numeric=TRUE,wpath=wpath) level <- 1:nmeteo ## set meteo data meteo <- get.geotop.inpts.keyword.value("MeteoFile",wpath=wpath,data.frame=TRUE, level=level,start_date=start,end_date=end,tz=tz) ##### end set meteo data ## IMPORTING AN OUTPUT SOIL MOISTURE PROFILE: wpath <- paste0( 'https://raw.githubusercontent.com/ecor/geotopbricks_doc/', 'master/simulations/Muntatschini_pnt_1_225_B2_004') ## URL Path (RAW VERSION) of ## https://github.com/ecor/geotopbricks_doc/tree/master/simulations/Muntatschini_pnt_1_225_B2_004 SMC <- get.geotop.inpts.keyword.value("SoilLiqContentProfileFile", wpath=wpath,data.frame=TRUE,date_field="Date12.DDMMYYYYhhmm.", formatter="%04d") SMCz <- get.geotop.inpts.keyword.value("SoilLiqContentProfileFile", wpath=wpath,data.frame=TRUE,date_field="Date12.DDMMYYYYhhmm.", formatter="%04d",zlayer.formatter="z%04d")
sf
object for Meteorological Stations or Control Points in a GEOtop simulationGet a sf
object for Meteorological Stations or Control Points in a GEOtop simulation
get.geotop.points( prefix = c("MeteoStation", "CoordinatePoint"), suffixes = c("Code", "Elevation", "Source"), coord_suffixes = list(MeteoStation = c("CoordinateX", "CoordinateY"), CoordinatePoint = c("X", "Y")), wpath, ..., vector_sep = "," )
get.geotop.points( prefix = c("MeteoStation", "CoordinatePoint"), suffixes = c("Code", "Elevation", "Source"), coord_suffixes = list(MeteoStation = c("CoordinateX", "CoordinateY"), CoordinatePoint = c("X", "Y")), wpath, ..., vector_sep = "," )
prefix |
keyword prefix |
suffixes |
keyword suffixes |
coord_suffixes |
coordinate keyword suffixes. Default is |
wpath |
GEOtop simulation path |
vector_sep , ...
|
further arguments for |
###See simulation template: "https://github.com/ecor/geotopbricks_doc/tree/master/template/sumava" wpath <- "https://raw.githubusercontent.com/ecor/geotopbricks_doc/master/template/sumava/" ## system.file("template/sumava",package="geotopbricks") out <- get.geotop.points(wpath=wpath) out <- get.geotop.points(prefix="CoordinatePoint",suffix=c("Code","Source"),wpath=wpath) out <- get.geotop.points(prefix="MeteoStation",suffix=c("Code","Source"),wpath=wpath)
###See simulation template: "https://github.com/ecor/geotopbricks_doc/tree/master/template/sumava" wpath <- "https://raw.githubusercontent.com/ecor/geotopbricks_doc/master/template/sumava/" ## system.file("template/sumava",package="geotopbricks") out <- get.geotop.points(wpath=wpath) out <- get.geotop.points(prefix="CoordinatePoint",suffix=c("Code","Source"),wpath=wpath) out <- get.geotop.points(prefix="MeteoStation",suffix=c("Code","Source"),wpath=wpath)
list
object.This function saves all spatially distrubuted information contained in the recovery folder into a comprehensive list
object.
get.geotop.recovery.state( recFolder, xx = "0000", formatter = "L%04d", extension = ".asc", nsoillayers = 10, layersFromDir = FALSE, ... )
get.geotop.recovery.state( recFolder, xx = "0000", formatter = "L%04d", extension = ".asc", nsoillayers = 10, layersFromDir = FALSE, ... )
recFolder |
directory when recvery maps are set. In GEOtop it is ... |
xx |
charcter String. Default is |
formatter |
string character for the the decimal formatter to be used. Default is |
extension |
file estension used for asccii recovery map files. It must contains |
nsoillayers |
number of soil layers used in the GEOtop simulation. |
layersFromDir |
logical value. If is |
... |
further arguments |
a list
object containining all recovery raster maps.
This function has been used with the built 1.225-9 of GEOtop .
Emanuele Cordano
raster
,set.geotop.recovery.state
,
write.vectorized.geotop.recovery
,read.vectorized.geotop.recovery
library(geotopbricks) example_Rscript <- system.file('template/example.geotop.recovery.state.R',package="geotopbricks") example_Rscript # Not Run because it elapses too long time!!! # Please Uncomment the following line to run by yourself!!! # source(example_Rscript)
library(geotopbricks) example_Rscript <- system.file('template/example.geotop.recovery.state.R',package="geotopbricks") example_Rscript # Not Run because it elapses too long time!!! # Please Uncomment the following line to run by yourself!!! # source(example_Rscript)
It reads the CRS metadata utilzed in a GEOtop Simulation
getProjection(x, cond = TRUE, ...)
getProjection(x, cond = TRUE, ...)
x |
name and full path of the file containimg CRS information |
cond |
logical value. If |
... |
futher arguments |
A string corresponding the projection and CRS if the argument cond
is TRUE
.
library(geotopbricks) wpath <- 'https://raw.githubusercontent.com/ecor/geotopbricks_doc/master/simulations/idroclim_test1' ## URL path (RAW VERSION) of ## https://github.com/ecor/geotopbricks_doc/tree/master/simulations/idroclim_test1 ## Not run: x <- paste(wpath,"geotop.proj",sep="/") crs <- getProjection(x) ## End(Not run)
library(geotopbricks) wpath <- 'https://raw.githubusercontent.com/ecor/geotopbricks_doc/master/simulations/idroclim_test1' ## URL path (RAW VERSION) of ## https://github.com/ecor/geotopbricks_doc/tree/master/simulations/idroclim_test1 ## Not run: x <- paste(wpath,"geotop.proj",sep="/") crs <- getProjection(x) ## End(Not run)
Interpolates the values of a 'brick' at a certain depth and returns the map of brick values at the "depth" level
getvalues.brick.at.depth(x, depth, layers, i0 = NULL, verify = FALSE, ...)
getvalues.brick.at.depth(x, depth, layers, i0 = NULL, verify = FALSE, ...)
x |
a 'RasterBrick' or a three-dimensional array |
depth |
depth map, generally a 'RasterLayer' object |
layers |
vector of layer thickness |
i0 |
a 'Raster' containing the number of soil laver just over the bedrock. Default is |
verify |
logical. Default is |
... |
further argument |
a list of 'Raster' maps:
i0
a 'Raster' containing the number of soil laver just over the bedrock
val_z0
a 'Raster' containing the values of x
at the i0
-th layer
val_z1
a 'Raster' containing the values of x
at the (i0
+1)-th layer
z0
a 'Raster' containing the depth of the center of the i0
-th layer
z1
a 'Raster' containing the depth of the center of the (i0
+1)-th layer
x
and depth
or i0
must cover the same spatial region.
vertical.aggregate.brick.within.depth
library(geotopbricks) # The examples is the following R script conteined in a 'inst' directory of the package source f <- system.file("doc/examples/example.getvalues.brick.at.depth.R",package="geotopbricks") # source(f) # Uncomment this line to run the example. # You can copy the example file using file.copy(from=f,to=....,...) See file.copy documentation
library(geotopbricks) # The examples is the following R script conteined in a 'inst' directory of the package source f <- system.file("doc/examples/example.getvalues.brick.at.depth.R",package="geotopbricks") # source(f) # Uncomment this line to run the example. # You can copy the example file using file.copy(from=f,to=....,...) See file.copy documentation
KML
method for a GeotopRasterBrick
object
## S4 method for signature 'GeotopRasterBrick' KML( x, filename, crs = as.character("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"), ... )
## S4 method for signature 'GeotopRasterBrick' KML( x, filename, crs = as.character("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"), ... )
x |
the |
filename |
mane of the KML file to produce |
crs |
character string containing the LatLon reference system. Default is |
... |
further argument for S4 method |
A coordinate transformation is made with projectRaster
.
library(geotopbricks) # The examples is the following R script contained in a 'inst' directory of the package source f <- system.file("doc/examples/example.KML.GeotopRasterBrick.R",package="geotopbricks") ## Not run: source(f) # Uncomment this line to run the example. ## End(Not run) # You can copy the example file using file.copy(from=f,to=....,...) See file.copy documentation
library(geotopbricks) # The examples is the following R script contained in a 'inst' directory of the package source f <- system.file("doc/examples/example.KML.GeotopRasterBrick.R",package="geotopbricks") ## Not run: source(f) # Uncomment this line to run the example. ## End(Not run) # You can copy the example file using file.copy(from=f,to=....,...) See file.copy documentation
Gets the maximum (scalar) values of a GeotopRasterBrick
object
max_value(x, na.rm = TRUE, ...)
max_value(x, na.rm = TRUE, ...)
x |
a |
na.rm , ...
|
further arguments for |
the maximum (scalar) values of a GeotopRasterBrick
object
Gets the minimum (scalar) values of a GeotopRasterBrick
object
min_value(x, na.rm = TRUE, ...)
min_value(x, na.rm = TRUE, ...)
x |
a |
na.rm , ...
|
further arguments foe |
the minimum (scalar) values of a GeotopRasterBrick
object
Ops
## S4 method for signature 'GeotopRasterBrick,GeotopRasterBrick' Ops(e1, e2) ## S4 method for signature 'GeotopRasterBrick,numeric' Ops(e1, e2) ## S4 method for signature 'numeric,GeotopRasterBrick' Ops(e1, e2)
## S4 method for signature 'GeotopRasterBrick,GeotopRasterBrick' Ops(e1, e2) ## S4 method for signature 'GeotopRasterBrick,numeric' Ops(e1, e2) ## S4 method for signature 'numeric,GeotopRasterBrick' Ops(e1, e2)
e1 , e2
|
the |
Ops
method for a GeotopRasterBrick
object
If e1
or e2
time index is not taken into account.
plot
method for a GeotopRasterBrick
object
## S4 method for signature 'GeotopRasterBrick,ANY' plot(x, y = NULL, ...)
## S4 method for signature 'GeotopRasterBrick,ANY' plot(x, y = NULL, ...)
x |
the |
y |
further argument |
... |
further argument for S4 method |
library(geotopbricks) # The examples is the following R script conteined in a 'inst' directory of the package source f <- system.file("doc/examples/example.plot.GeotopRasterBrick.R",package="geotopbricks") # source(f) # Uncomment this line to run the example. # You can copy the example file using file.copy(from=f,to=....,...) See file.copy documentation
library(geotopbricks) # The examples is the following R script conteined in a 'inst' directory of the package source f <- system.file("doc/examples/example.plot.GeotopRasterBrick.R",package="geotopbricks") # source(f) # Uncomment this line to run the example. # You can copy the example file using file.copy(from=f,to=....,...) See file.copy documentation
'pointer.to.maps.xyz.time' function (obsolete)
pointer.to.maps.xyz.time( wpath, map.prefix = "thetaliq", suffix = "L%04dN%04d.asc", zoo.index = NULL, ntime, nlayers )
pointer.to.maps.xyz.time( wpath, map.prefix = "thetaliq", suffix = "L%04dN%04d.asc", zoo.index = NULL, ntime, nlayers )
wpath |
complete working path to *.asc maps are saved |
map.prefix |
string prefix name map before |
suffix |
z-time or time suffix plus file extention character string. Default for GEOtop application is |
zoo.index |
time or date index. Default is |
ntime |
number of time instant. If |
nlayers |
number of vertical layers. |
A data.frame or zoo object containig the paths to maps fpr each time and z layer.
Emanuele Cordano
'geotop.inpts'
file.Read a text file containing values and matedata of a z-layer brick referred to a time instant (e.g. date). The file is formatted like an ascii format like 'geotop.inpts'
file.
read.ascii.vectorized.brick( file = NULL, comment = "!", crs = "", NAflag = -9999, matlab.syntax = FALSE, ... )
read.ascii.vectorized.brick( file = NULL, comment = "!", crs = "", NAflag = -9999, matlab.syntax = FALSE, ... )
file |
file name to write |
comment |
character. Comment indicator. Default is |
crs |
Character or object of class CRS. PROJ4 type description of a Coordinate Reference System (map projection) (optional). See |
NAflag |
numeric. Dafauli is -9999, see |
matlab.syntax |
logical value. Default is |
... |
further aguments inserted as attribute |
the RasterBrick-class
object
# see the examples of read.ascii.vectorized.brick
# see the examples of read.ascii.vectorized.brick
It imports a 'RasterLayer' object in Escri-Asci format from a URL 'http(s)://....<FILENAME>.asc
read.raster.from.url(x, header_nrow = 6, ...)
read.raster.from.url(x, header_nrow = 6, ...)
x |
the charcater string containing the URL address |
header_nrow |
Number of header in the ASCII grid format. Deafault is 6. See https://en.wikipedia.org/wiki/Esri_grid |
... |
additional arguments |
a 'RasterLayer' object
This function reads a local or remote text files formatted as https://en.wikipedia.org/wiki/Esri_grid and creates a 'RasterLayer' object.
write.vectorized.geotop.recovery
#. containing values and matedata of a z-layer brick referred to a time instant (e.g. date). The file is formatted like an ascii format like 'geotop.inpts'
file.
read.vectorized.geotop.recovery( file = file, comment = "!", matlab.syntax = TRUE, xx = "0000", formatter = "L%04d", extension = ".asc", NAflag = -9999, crs = "", ... )
read.vectorized.geotop.recovery( file = file, comment = "!", matlab.syntax = TRUE, xx = "0000", formatter = "L%04d", extension = ".asc", NAflag = -9999, crs = "", ... )
file |
file name to write |
comment |
character. Comment indicator. Default is |
matlab.syntax |
logical value. Default is |
formatter , extension , xx
|
|
NAflag |
numeric. Default is -9999, see |
crs |
Character or object of class CRS. PROJ4 type description of a Coordinate Reference System (map projection) (optional). See |
... |
further aguments inserted as attribute |
a list
object like get.geotop.recovery.state
write.vectorized.geotop.recovery
# see the examples of read.ascii.vectorized.brick
# see the examples of read.ascii.vectorized.brick
geotop.inpts
file with the ones of anoter *.inpts
valueIt replaces some keyword values of geotop.inpts
file with the ones of anoter *.inpts
value
replace.keyword( x, y = "geotop.inpts", file.output = NULL, write.file.output = TRUE, wpath = NULL, ... )
replace.keyword( x, y = "geotop.inpts", file.output = NULL, write.file.output = TRUE, wpath = NULL, ... )
x |
filename of the |
y |
filename of the |
file.output |
filename where to write the comprehensive new |
write.file.output |
logical value. If it is |
wpath |
working path to the GEOtop simulation folder containing the |
... |
further arguments |
This function repleces some keword values of y
with the ones indicated in y
. It is useful to replace the meteo station metedata, for instance, when the meteorological station of a study cases are modified.
The function returns the new geotop.inpts
file as a vector of character strings. If write.file.output==TRUE
, the output is written in an extarnal file, e.g. "geotop.inpts"
newly (this option is suggested).
Emanuele Cordano
library(geotopbricks) wpath <- system.file('template/meteo_ex',package="geotopbricks") x <- "meteo.inpts" zl <- replace.keyword(x,wpath=wpath,write.file.output=FALSE)
library(geotopbricks) wpath <- system.file('template/meteo_ex',package="geotopbricks") x <- "meteo.inpts" zl <- replace.keyword(x,wpath=wpath,write.file.output=FALSE)
This function re-writes the recovery ascii raster maps in a given folder
set.geotop.recovery.state(rec, newRecFolder, ...)
set.geotop.recovery.state(rec, newRecFolder, ...)
rec |
a |
newRecFolder |
directory where to write all recovery raster asccii maps |
... |
further arguments |
Emanuele Cordano
get.geotop.recovery.state
,writeRasterxGEOtop
# See the examples of the 'get.geotop.recovery.state' function
# See the examples of the 'get.geotop.recovery.state' function
Aggregates with a mean or an addition on the vertical profile the values of a 'brick' within a certain depth and returns the vertical aggregated map
vertical.aggregate.brick.within.depth( x, depth = NULL, layers = NULL, i0 = NULL, verify = FALSE, FUN = identity, divide.by.depth = FALSE, ... )
vertical.aggregate.brick.within.depth( x, depth = NULL, layers = NULL, i0 = NULL, verify = FALSE, FUN = identity, divide.by.depth = FALSE, ... )
x |
a 'RasterBrick' or a three-dimensional array |
depth |
depth map, generally a 'RasterLayer' object |
layers |
vector of layer thickness |
i0 |
a 'Raster' containing the number of soil laver just over the bedrock. Default is |
verify |
logical. Default is |
FUN |
function used for aggregation. If missing, |
divide.by.depth |
logical. If |
... |
further argument for |
a list of 'Raster' maps:
i0
a 'Raster' containing the number of soil laver just over the bedrock
z0
a 'Raster' containing the depth of the center of the i0
-th layer
result
a 'Raster' containing the aggregated map
x
and depth
or i0
must cover the same spatial region.
getvalues.brick.at.depth
,brick
library(geotopbricks) # The examples is the following R script conteined # in a 'inst' directory of the package source f <- system.file("doc/examples/example.vertical.aggregate.brick.within.depth.R", package="geotopbricks") # source(f) # Uncomment this line to run the example. # You can copy the example file using file.copy(from=f,to=....,...) See file.copy documentation
library(geotopbricks) # The examples is the following R script conteined # in a 'inst' directory of the package source f <- system.file("doc/examples/example.vertical.aggregate.brick.within.depth.R", package="geotopbricks") # source(f) # Uncomment this line to run the example. # You can copy the example file using file.copy(from=f,to=....,...) See file.copy documentation
'geotop.inpts'
file.Writes a z-layer brick referred to a time instant (e.g. date) in an ascii format like 'geotop.inpts'
file.
write.ascii.vectorized.brick( b, file = NULL, header = NULL, overwrite = TRUE, NAflag = -9999, matlab.syntax = FALSE, ... )
write.ascii.vectorized.brick( b, file = NULL, header = NULL, overwrite = TRUE, NAflag = -9999, matlab.syntax = FALSE, ... )
b |
a |
file |
file name to write |
header |
character string vector for header text lines. If missing, a default header is written. #Default is |
overwrite |
logical. Default is |
NAflag |
numeric. Default is -9999, see |
matlab.syntax |
logical value. Default is |
... |
further aguments inserted as attribute |
the string vector possibly written in file
.
Add Quote if necessary. This function is NOT maintained and will be DEPRECATED.
## Not Run ## library(geotopbricks) ## library(raster) ## file <- system.file("doc/examples/snowthickness",package="geotopbricks") ## file <- paste(file,"SnowThickness0000L%04d.asc",sep="/") ## b <- brick.decimal.formatter(file=file,nlayers=15) ## nlayers(b) ## names(b) ## file <- "snow.txt" ## btext <- write.ascii.vectorized.brick(b,Date="1/1/2009",file="snow.txt") ## The printed object ## str(btext) ## bb <- read.ascii.vectorized.brick(file = file) ## bf <- abs(as.matrix(bb[[1]]-b[[1]]))<.Machine$double.eps^0.5
## Not Run ## library(geotopbricks) ## library(raster) ## file <- system.file("doc/examples/snowthickness",package="geotopbricks") ## file <- paste(file,"SnowThickness0000L%04d.asc",sep="/") ## b <- brick.decimal.formatter(file=file,nlayers=15) ## nlayers(b) ## names(b) ## file <- "snow.txt" ## btext <- write.ascii.vectorized.brick(b,Date="1/1/2009",file="snow.txt") ## The printed object ## str(btext) ## bb <- read.ascii.vectorized.brick(file = file) ## bf <- abs(as.matrix(bb[[1]]-b[[1]]))<.Machine$double.eps^0.5
data.frame
or zoo
) into a CSV file readible by GEOtop.Writes an R object (data.frame
or zoo
) into a CSV file readible by GEOtop.
write.geotop.table( x, file, wpath = NULL, tz = "Etc/GMT-1", date_field = "Date12.DDMMYYYYhhmm.", file_end = "", sep = ",", format = "%d/%m/%Y %H:%M", na = "-9999", ... )
write.geotop.table( x, file, wpath = NULL, tz = "Etc/GMT-1", date_field = "Date12.DDMMYYYYhhmm.", file_end = "", sep = ",", format = "%d/%m/%Y %H:%M", na = "-9999", ... )
x |
R object ( |
file |
filename |
wpath |
working path to the GEOtop simlation. If |
tz |
time zone. Default is |
date_field |
string used for date-time field. Deafult is |
file_end |
suffix of the file name ( |
sep |
separator character. Default is |
format |
date time format. Default is |
na |
string for unassigned values. Defaults is |
... |
further arguments for |
list
object returened by get.geotop.recovery.state
as a string vector or in a text file, following *.inpts
or Matlab-like syntax.It writes a list
object returened by get.geotop.recovery.state
as a string vector or in a text file, following *.inpts
or Matlab-like syntax.
write.vectorized.geotop.recovery( rec, file = NULL, header = NULL, overwrite = TRUE, NAflag = -9999, matlab.syntax = TRUE, ... )
write.vectorized.geotop.recovery( rec, file = NULL, header = NULL, overwrite = TRUE, NAflag = -9999, matlab.syntax = TRUE, ... )
rec |
a |
file |
ascii text file name whrere to write the string vector |
header |
character string vector for header text lines. If missing, a default header is written. Default is |
overwrite |
logical. Default is |
NAflag |
numeric. Default is -9999, see |
matlab.syntax |
logical value. Default is |
... |
further aguments inserted as attribute |
a string vector containg the rec
variables.
Add Quote if necessary
get.geotop.recovery.state
,set.geotop.recovery.state
,write.vectorized.variable.in.string
# See the examples of the 'get.geotop.recovery.state' function
# See the examples of the 'get.geotop.recovery.state' function
*.inpts
or Matlab-like syntax.Writes one or more variables (scalars, vectors or Rasters) in a string each, following *.inpts
or Matlab-like syntax.
write.vectorized.variable.in.string( l, NAflag = -9999, matlab.syntax = FALSE, ... )
write.vectorized.variable.in.string( l, NAflag = -9999, matlab.syntax = FALSE, ... )
l |
a |
NAflag |
numeric. Default is -9999, see |
matlab.syntax |
logical value. Default is |
... |
further aguments |
the string vector <NAME_VARIABLE>==<VALUES_VARIABLE>
.
Add Quote if necessary
a <- 1:5 l <- list(v=a,a=a) out <- write.vectorized.variable.in.string(l,matlab.syntax=TRUE) out
a <- 1:5 l <- list(v=a,a=a) out <- write.vectorized.variable.in.string(l,matlab.syntax=TRUE) out
writeRaster
to create .asc maps which can be read by GEOtopThis function uses writeRaster
to create .asc maps which can be read by GEOtop
writeRasterxGEOtop( x, filename = NULL, overwrite = TRUE, NAflag = -9999, use.decimal.formatter = FALSE, start.from.zero = FALSE, keyword, wpath, suffix.ext = ".asc", ... )
writeRasterxGEOtop( x, filename = NULL, overwrite = TRUE, NAflag = -9999, use.decimal.formatter = FALSE, start.from.zero = FALSE, keyword, wpath, suffix.ext = ".asc", ... )
x |
a Raster object, see |
filename |
see |
overwrite |
logical. Default is |
NAflag |
numeric. Dafauli is -9999, see |
use.decimal.formatter |
logical value. Default is |
start.from.zero |
logical value. Default is |
keyword |
geotop keyword to be used to extract the raster file name from |
wpath |
simulation folder containing |
suffix.ext |
charachter string to be added to the |
... |
further arguments of |
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.
file <- system.file("ex/elev.tif", package="terra") elev <- raster(file) elevfile <- rasterTmpFile() extension(elevfile) <- ".asc" writeRasterxGEOtop(x=elev,file=elevfile)
file <- system.file("ex/elev.tif", package="terra") elev <- raster(file) elevfile <- rasterTmpFile() extension(elevfile) <- ".asc" writeRasterxGEOtop(x=elev,file=elevfile)
A GeotopRasterBrick: an object to manage raster maps provied by GEOtop!!
showClass("zoo")
showClass("zoo")