many bugfixes

This commit is contained in:
hollorol
2018-05-15 15:07:03 +02:00
parent 15c174fa18
commit af16508b9e
6 changed files with 147 additions and 58 deletions
+36
View File
@@ -248,3 +248,39 @@
if(length(irrInput)==2){
iniFiles[[2]][grep("do IRRIGATION",iniFiles[[2]])]<-paste(irrInput[2],"do IRRIGATION",sep="")
}}
getthewholedata<-function(settings){
f1<-settings$ininput[2]
filename = paste(settings$inputloc,settings$outputname,"_ann.txt",sep="")
alloutput<-read.table(filename,skip=22, header = FALSE)
return(alloutput)
}
getthespecdata<-function(settings,colnumbers){
filename<-paste(settings$inputloc,settings$outputname,"_ann.txt",sep="")
specoutput<-read.table(filename,skip=22, header = FALSE)[,colnumbers]
return(specoutput)
}
getdailyout<-function(settings){
binaryname<-paste(settings$inputLoc,settings$outputNames,".dayout",sep="")
d<-file(binaryname,"rb")
dayoutput<-matrix(readBin(d,"double",size=8,n=(settings$numData[1])),(settings$numYears*365),byrow=TRUE)
close(d)
return(dayoutput)
}
getmonthlyout<-function(settings){
binaryname<-paste(settings$inputloc,settings$outputname,".monavgout",sep="")
d<-file(binaryname,"rb")
monoutput<-matrix(readBin(d,"double",size=4,n=(settings$numdata[2])),(settings$numyears*12),byrow=TRUE)
close(d)
return(monoutput)
}
getyearlyout<-function(settings){
binaryname<-paste(settings$inputloc,settings$outputname,".annout",sep="")
d<-file(binaryname,"rb")
yearoutput<-matrix(readBin(d,"double",size=4,n=(settings$numdata[3])),(settings$numyears),byrow=TRUE)
close(d)
return(yearoutput)
}