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