TransfoParam_GR1A.R 502 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
TransfoParam_GR1A <- function(ParamIn, Direction) {
  
  NParam <- 1
  Bool <- is.matrix(ParamIn)
  
  if (Bool == FALSE) {
    ParamIn <- rbind(ParamIn)
  }
  
  if (ncol(ParamIn) != NParam) {
11
    stop(paste("the GR1A model requires ", NParam, " parameters", sep = ""))
12
13
14
  }
  
  if (Direction == "TR") {
15
    ParamOut <- (ParamIn + 10.0) / 8
16
17
  }
  if (Direction == "RT") {
18
    ParamOut <-  ParamIn * 8 - 10.0
19
20
21
22
23
24
25
26
  }
  
  if (Bool == FALSE) {
    ParamOut <- ParamOut[1, ]
    
  }
  return(ParamOut)
  
Delaigue Olivier's avatar
Delaigue Olivier committed
27
}