Adding prettyOut option to calibMuso

This commit is contained in:
hollorol 2018-12-07 19:56:48 +01:00
parent 044f71d346
commit 021d889fd1
3 changed files with 40 additions and 16 deletions

View File

@ -17,6 +17,7 @@
#' @param binaryPlace The place of the binary output files.
#' @param fileToChange You can change any line of the epc or the ini file, you just have to specify with this variable which file you van a change. Two options possible: "epc", "ini"
#' @param skipSpinup If TRUE, calibMuso wont do spinup simulation
#' @param prettyOut date ad Date type, separate year, month, day vectors
#' @return No return, outputs are written to file
#' @usage calibMuso(settings,parameters=NULL, timee="d", debugging=FALSE, logfilename=NULL,
#' keepEpc=FALSE, export=FALSE, silent=FALSE, aggressive=FALSE, leapYear=FALSE)
@ -30,7 +31,7 @@ calibMuso <- function(settings=NULL, calibrationPar=NULL,
silent=FALSE, aggressive=FALSE,
leapYear=FALSE,keepBinary=FALSE,
binaryPlace="./", fileToChange="epc",
skipSpinup = TRUE, modifyOriginal =FALSE){
skipSpinup = TRUE, modifyOriginal =FALSE, prettyOut = FALSE){
##########################################################################
###########################Set local variables and places########################
########################################################################
@ -321,7 +322,21 @@ calibMuso <- function(settings=NULL, calibrationPar=NULL,
}
if(timee=="d"){
colnames(Reva) <- unlist(settings$outputVars[[1]])
if(!prettyOut){
colnames(Reva) <- unlist(settings$outputVars[[1]])
} else{
dates <- as.Date(musoDate(startYear = settings$startYear,
numYears = settings$numYears,
timestep="d",combined = TRUE,corrigated = FALSE),
"%d.%m.%Y")
Reva <- cbind.data.frame(dates,
musoDate(startYear = settings$startYear,
numYears = settings$numYears,
timestep = "d", combined = FALSE, corrigated = FALSE),
Reva)
colnames(Reva) <- as.character(c("date","day","month","year",unlist(settings$outputVars[[1]])) )
}
} else {
if(timee=="y")
colnames(Reva) <- unlist(settings$outputVars[[2]])
@ -331,9 +346,15 @@ calibMuso <- function(settings=NULL, calibrationPar=NULL,
if(leapYear){
Reva <- corrigMuso(settings,Reva)
rownames(Reva) <- musoDate(settings$startYear,settings$numYears)
} else {
rownames(Reva) <- musoDate(settings$startYear, settings$numYears, corrigated=FALSE)
if(!prettyOut){
rownames(Reva) <- musoDate(settings$startYear,settings$numYears)
}
} else {
if(!prettyOut){
rownames(Reva) <- musoDate(settings$startYear, settings$numYears, corrigated=FALSE)
}
}

View File

@ -1,11 +0,0 @@
# This is the official repository of the RBBCMuSo package
Written by Roland HOLLÓS, Dóra HIDY
E-mail: <hollorol@protonmail.com>
## Acknowledgements
The research was funded by the Széchenyi 2020 programme, the European Regional Development Fund and the Hungarian Government (GINOP-2.3.2-15-2016-00028).

14
README.org Normal file
View File

@ -0,0 +1,14 @@
#+TITLE: This is the official repository of the RBBCMuSo package
#+AUTHOR: Roland HOLLÓS, Dóra HIDY, Zoltán BARCZA
Written by Roland HOLLÓS, Dóra HIDY
E-mail: hollorol@gmail.com
* Introduction
* Installation
* Usage
* Acknowledgements
The research was funded by the Széchenyi 2020 programme, the European Regional Development Fund and the Hungarian Government (GINOP-2.3.2-15-2016-00028).