Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
HYCAR-Hydro
airGR
Commits
c63f3cfe
Commit
c63f3cfe
authored
Apr 14, 2016
by
Delaigue Olivier
Browse files
Mise en forme des examples
parent
6f152d24
Changes
9
Hide whitespace changes
Inline
Side-by-side
tests/example_Calibration.R
View file @
c63f3cfe
...
@@ -18,12 +18,12 @@ InputsCrit <- CreateInputsCrit(FUN_CRIT=ErrorCrit_NSE,InputsModel=InputsModel,
...
@@ -18,12 +18,12 @@ InputsCrit <- CreateInputsCrit(FUN_CRIT=ErrorCrit_NSE,InputsModel=InputsModel,
RunOptions
=
RunOptions
,
Qobs
=
BasinObs
$
Qmm
[
Ind_Run
])
RunOptions
=
RunOptions
,
Qobs
=
BasinObs
$
Qmm
[
Ind_Run
])
## preparation of CalibOptions object
## preparation of CalibOptions object
CalibOptions
<-
CreateCalibOptions
(
FUN_MOD
=
RunModel_GR4J
,
FUN_CALIB
=
Calibration_
HBAN
)
CalibOptions
<-
CreateCalibOptions
(
FUN_MOD
=
RunModel_GR4J
,
FUN_CALIB
=
Calibration_
Michel
)
## calibration
## calibration
OutputsCalib
<-
Calibration
(
InputsModel
=
InputsModel
,
RunOptions
=
RunOptions
,
InputsCrit
=
InputsCrit
,
OutputsCalib
<-
Calibration
(
InputsModel
=
InputsModel
,
RunOptions
=
RunOptions
,
InputsCrit
=
InputsCrit
,
CalibOptions
=
CalibOptions
,
FUN_MOD
=
RunModel_GR4J
,
FUN_CRIT
=
ErrorCrit_NSE
,
CalibOptions
=
CalibOptions
,
FUN_MOD
=
RunModel_GR4J
,
FUN_CRIT
=
ErrorCrit_NSE
,
FUN_CALIB
=
Calibration_
HBAN
)
FUN_CALIB
=
Calibration_
Michel
)
## simulation
## simulation
Param
<-
OutputsCalib
$
ParamFinalR
Param
<-
OutputsCalib
$
ParamFinalR
...
...
tests/example_TransfoParam.R
View file @
c63f3cfe
require
(
airGR
)
require
(
airGR
)
## transformation R
eal
->Transformed for the GR4J model
## transformation R
aw
->Transformed for the GR4J model
Xr
eal
<-
matrix
(
c
(
221.41
,
-3.63
,
30.00
,
1.37
,
Xr
aw
<-
matrix
(
c
(
221.41
,
-3.63
,
30.00
,
1.37
,
347.23
,
-1.03
,
60.34
,
1.76
,
347.23
,
-1.03
,
60.34
,
1.76
,
854.06
,
-0.10
,
148.41
,
2.34
),
854.06
,
-0.10
,
148.41
,
2.34
),
ncol
=
4
,
byrow
=
TRUE
)
ncol
=
4
,
byrow
=
TRUE
)
Xtran
<-
TransfoParam
(
ParamIn
=
Xr
eal
,
Direction
=
"RT"
,
FUN_TRANSFO
=
TransfoParam_GR4J
)
Xtran
<-
TransfoParam
(
ParamIn
=
Xr
aw
,
Direction
=
"RT"
,
FUN_TRANSFO
=
TransfoParam_GR4J
)
## transformation Transformed->R
eal
for the GR4J model
## transformation Transformed->R
aw
for the GR4J model
Xtran
<-
matrix
(
c
(
+3.60
,
-2.00
,
+3.40
,
-9.10
,
Xtran
<-
matrix
(
c
(
+3.60
,
-2.00
,
+3.40
,
-9.10
,
+3.90
,
-0.90
,
+4.10
,
-8.70
,
+3.90
,
-0.90
,
+4.10
,
-8.70
,
+4.50
,
-0.10
,
+5.00
,
-8.10
),
+4.50
,
-0.10
,
+5.00
,
-8.10
),
ncol
=
4
,
byrow
=
TRUE
)
ncol
=
4
,
byrow
=
TRUE
)
Xr
eal
<-
TransfoParam
(
ParamIn
=
Xtran
,
Direction
=
"TR"
,
FUN_TRANSFO
=
TransfoParam_GR4J
)
Xr
aw
<-
TransfoParam
(
ParamIn
=
Xtran
,
Direction
=
"TR"
,
FUN_TRANSFO
=
TransfoParam_GR4J
)
tests/example_TransfoParam_CemaNeige.R
View file @
c63f3cfe
require
(
airGR
)
require
(
airGR
)
## transformation R
eal
->Transformed for the CemaNeige module
## transformation R
aw
->Transformed for the CemaNeige module
Xr
eal
<-
matrix
(
c
(
0.19
,
1.73
,
Xr
aw
<-
matrix
(
c
(
0.19
,
1.73
,
0.39
,
2.51
,
0.39
,
2.51
,
0.74
,
4.06
),
0.74
,
4.06
),
ncol
=
2
,
byrow
=
TRUE
)
ncol
=
2
,
byrow
=
TRUE
)
Xtran
<-
TransfoParam_CemaNeige
(
ParamIn
=
Xr
eal
,
Direction
=
"RT"
)
Xtran
<-
TransfoParam_CemaNeige
(
ParamIn
=
Xr
aw
,
Direction
=
"RT"
)
## transformation Transformed->R
eal
for the CemaNeige module
## transformation Transformed->R
aw
for the CemaNeige module
Xtran
<-
matrix
(
c
(
-6.26
,
+0.55
,
Xtran
<-
matrix
(
c
(
-6.26
,
+0.55
,
-2.13
,
+0.92
,
-2.13
,
+0.92
,
+4.86
,
+1.40
)
+4.86
,
+1.40
)
,
ncol
=
2
,
byrow
=
TRUE
)
,
ncol
=
2
,
byrow
=
TRUE
)
Xr
eal
<-
TransfoParam_CemaNeige
(
ParamIn
=
Xtran
,
Direction
=
"TR"
)
Xr
aw
<-
TransfoParam_CemaNeige
(
ParamIn
=
Xtran
,
Direction
=
"TR"
)
tests/example_TransfoParam_GR1A.R
View file @
c63f3cfe
require
(
airGR
)
require
(
airGR
)
## transformation R
eal
->Transformed for the GR1A model
## transformation R
aw
->Transformed for the GR1A model
Xr
eal
<-
matrix
(
c
(
0.625
,
Xr
aw
<-
matrix
(
c
(
0.625
,
1.250
,
1.250
,
1.875
),
1.875
),
ncol
=
1
,
byrow
=
TRUE
)
ncol
=
1
,
byrow
=
TRUE
)
Xtran
<-
TransfoParam_GR1A
(
ParamIn
=
Xr
eal
,
Direction
=
"RT"
)
Xtran
<-
TransfoParam_GR1A
(
ParamIn
=
Xr
aw
,
Direction
=
"RT"
)
## transformation Transformed->R
eal
for the GR1A model
## transformation Transformed->R
aw
for the GR1A model
Xtran
<-
matrix
(
c
(
-5.00
,
Xtran
<-
matrix
(
c
(
-5.00
,
+0.00
,
+0.00
,
+5.00
),
+5.00
),
ncol
=
1
,
byrow
=
TRUE
)
ncol
=
1
,
byrow
=
TRUE
)
Xr
eal
<-
TransfoParam_GR1A
(
ParamIn
=
Xtran
,
Direction
=
"TR"
)
Xr
aw
<-
TransfoParam_GR1A
(
ParamIn
=
Xtran
,
Direction
=
"TR"
)
tests/example_TransfoParam_GR2M.R
View file @
c63f3cfe
require
(
airGR
)
require
(
airGR
)
## transformation R
eal
->Transformed for the GR2M model
## transformation R
aw
->Transformed for the GR2M model
Xr
eal
<-
matrix
(
c
(
221.41
,
-1.00
,
Xr
aw
<-
matrix
(
c
(
221.41
,
-1.00
,
347.23
,
+0.00
,
347.23
,
+0.00
,
854.01
,
+1.00
),
854.01
,
+1.00
),
ncol
=
2
,
byrow
=
TRUE
)
ncol
=
2
,
byrow
=
TRUE
)
Xtran
<-
TransfoParam_GR2M
(
ParamIn
=
Xr
eal
,
Direction
=
"RT"
)
Xtran
<-
TransfoParam_GR2M
(
ParamIn
=
Xr
aw
,
Direction
=
"RT"
)
## transformation Transformed->R
eal
for the GR2M model
## transformation Transformed->R
aw
for the GR2M model
Xtran
<-
matrix
(
c
(
+3.60
,
-5.00
,
Xtran
<-
matrix
(
c
(
+3.60
,
-5.00
,
+3.90
,
+0.00
,
+3.90
,
+0.00
,
+4.50
,
+5.00
),
+4.50
,
+5.00
),
ncol
=
2
,
byrow
=
TRUE
)
ncol
=
2
,
byrow
=
TRUE
)
Xr
eal
<-
TransfoParam_GR2M
(
ParamIn
=
Xtran
,
Direction
=
"TR"
)
Xr
aw
<-
TransfoParam_GR2M
(
ParamIn
=
Xtran
,
Direction
=
"TR"
)
tests/example_TransfoParam_GR4H.R
View file @
c63f3cfe
require
(
airGR
)
require
(
airGR
)
## transformation R
eal
->Transformed for the GR4H model
## transformation R
aw
->Transformed for the GR4H model
Xr
eal
<-
matrix
(
c
(
221.41
,
-3.63
,
30.00
,
1.37
,
Xr
aw
<-
matrix
(
c
(
221.41
,
-3.63
,
30.00
,
1.37
,
347.23
,
-1.03
,
60.34
,
1.76
,
347.23
,
-1.03
,
60.34
,
1.76
,
854.06
,
-0.10
,
148.41
,
2.34
),
854.06
,
-0.10
,
148.41
,
2.34
),
ncol
=
4
,
byrow
=
TRUE
)
ncol
=
4
,
byrow
=
TRUE
)
Xtran
<-
TransfoParam_GR4H
(
ParamIn
=
Xr
eal
,
Direction
=
"RT"
)
Xtran
<-
TransfoParam_GR4H
(
ParamIn
=
Xr
aw
,
Direction
=
"RT"
)
## transformation Transformed->R
eal
for the GR4H model
## transformation Transformed->R
aw
for the GR4H model
Xtran
<-
matrix
(
c
(
+3.60
,
-2.00
,
+3.40
,
-9.10
,
Xtran
<-
matrix
(
c
(
+3.60
,
-2.00
,
+3.40
,
-9.10
,
+3.90
,
-0.90
,
+4.10
,
-8.70
,
+3.90
,
-0.90
,
+4.10
,
-8.70
,
+4.50
,
-0.10
,
+5.00
,
-8.10
),
+4.50
,
-0.10
,
+5.00
,
-8.10
),
ncol
=
4
,
byrow
=
TRUE
)
ncol
=
4
,
byrow
=
TRUE
)
Xr
eal
<-
TransfoParam_GR4H
(
ParamIn
=
Xtran
,
Direction
=
"TR"
)
Xr
aw
<-
TransfoParam_GR4H
(
ParamIn
=
Xtran
,
Direction
=
"TR"
)
tests/example_TransfoParam_GR4J.R
View file @
c63f3cfe
require
(
airGR
)
require
(
airGR
)
## transformation R
eal
->Transformed for the GR4J model
## transformation R
aw
->Transformed for the GR4J model
Xr
eal
<-
matrix
(
c
(
221.41
,
-3.63
,
30.00
,
1.37
,
Xr
aw
<-
matrix
(
c
(
221.41
,
-3.63
,
30.00
,
1.37
,
347.23
,
-1.03
,
60.34
,
1.76
,
347.23
,
-1.03
,
60.34
,
1.76
,
854.06
,
-0.10
,
148.41
,
2.34
),
854.06
,
-0.10
,
148.41
,
2.34
),
ncol
=
4
,
byrow
=
TRUE
)
ncol
=
4
,
byrow
=
TRUE
)
Xtran
<-
TransfoParam_GR4J
(
ParamIn
=
Xr
eal
,
Direction
=
"RT"
)
Xtran
<-
TransfoParam_GR4J
(
ParamIn
=
Xr
aw
,
Direction
=
"RT"
)
## transformation Transformed->R
eal
for the GR4J model
## transformation Transformed->R
aw
for the GR4J model
Xtran
<-
matrix
(
c
(
+3.60
,
-2.00
,
+3.40
,
-9.10
,
Xtran
<-
matrix
(
c
(
+3.60
,
-2.00
,
+3.40
,
-9.10
,
+3.90
,
-0.90
,
+4.10
,
-8.70
,
+3.90
,
-0.90
,
+4.10
,
-8.70
,
+4.50
,
-0.10
,
+5.00
,
-8.10
),
+4.50
,
-0.10
,
+5.00
,
-8.10
),
ncol
=
4
,
byrow
=
TRUE
)
ncol
=
4
,
byrow
=
TRUE
)
Xr
eal
<-
TransfoParam_GR4J
(
ParamIn
=
Xtran
,
Direction
=
"TR"
)
Xr
aw
<-
TransfoParam_GR4J
(
ParamIn
=
Xtran
,
Direction
=
"TR"
)
tests/example_TransfoParam_GR5J.R
View file @
c63f3cfe
require
(
airGR
)
require
(
airGR
)
## transformation R
eal
->Transformed for the GR5J model
## transformation R
aw
->Transformed for the GR5J model
Xr
eal
<-
matrix
(
c
(
221.41
,
-2.65
,
27.11
,
1.37
,
-0.76
,
Xr
aw
<-
matrix
(
c
(
221.41
,
-2.65
,
27.11
,
1.37
,
-0.76
,
347.23
,
-0.64
,
60.34
,
1.76
,
0.30
,
347.23
,
-0.64
,
60.34
,
1.76
,
0.30
,
854.01
,
-0.10
,
148.41
,
2.34
,
0.52
),
854.01
,
-0.10
,
148.41
,
2.34
,
0.52
),
ncol
=
5
,
byrow
=
TRUE
)
ncol
=
5
,
byrow
=
TRUE
)
Xtran
<-
TransfoParam_GR5J
(
ParamIn
=
Xr
eal
,
Direction
=
"RT"
)
Xtran
<-
TransfoParam_GR5J
(
ParamIn
=
Xr
aw
,
Direction
=
"RT"
)
## transformation Transformed->R
eal
for the GR5J model
## transformation Transformed->R
aw
for the GR5J model
Xtran
<-
matrix
(
c
(
+3.60
,
-1.70
,
+3.30
,
-9.10
,
-0.70
,
Xtran
<-
matrix
(
c
(
+3.60
,
-1.70
,
+3.30
,
-9.10
,
-0.70
,
+3.90
,
-0.60
,
+4.10
,
-8.70
,
+0.30
,
+3.90
,
-0.60
,
+4.10
,
-8.70
,
+0.30
,
+4.50
,
-0.10
,
+5.00
,
-8.10
,
+0.50
),
+4.50
,
-0.10
,
+5.00
,
-8.10
,
+0.50
),
ncol
=
5
,
byrow
=
TRUE
)
ncol
=
5
,
byrow
=
TRUE
)
Xr
eal
<-
TransfoParam_GR5J
(
ParamIn
=
Xtran
,
Direction
=
"TR"
)
Xr
aw
<-
TransfoParam_GR5J
(
ParamIn
=
Xtran
,
Direction
=
"TR"
)
tests/example_TransfoParam_GR6J.R
View file @
c63f3cfe
require
(
airGR
)
require
(
airGR
)
## transformation R
eal
->Transformed for the GR6J model
## transformation R
aw
->Transformed for the GR6J model
Xr
eal
<-
matrix
(
c
(
221.41
,
-1.18
,
27.11
,
1.37
,
-0.18
,
20.09
,
Xr
aw
<-
matrix
(
c
(
221.41
,
-1.18
,
27.11
,
1.37
,
-0.18
,
20.09
,
347.23
,
-0.52
,
60.34
,
1.76
,
0.02
,
54.60
,
347.23
,
-0.52
,
60.34
,
1.76
,
0.02
,
54.60
,
854.06
,
0.52
,
148.41
,
2.34
,
0.22
,
148.41
),
854.06
,
0.52
,
148.41
,
2.34
,
0.22
,
148.41
),
ncol
=
6
,
byrow
=
TRUE
)
ncol
=
6
,
byrow
=
TRUE
)
Xtran
<-
TransfoParam_GR6J
(
ParamIn
=
Xr
eal
,
Direction
=
"RT"
)
Xtran
<-
TransfoParam_GR6J
(
ParamIn
=
Xr
aw
,
Direction
=
"RT"
)
## transformation Transformed->R
eal
for the GR6J model
## transformation Transformed->R
aw
for the GR6J model
Xtran
<-
matrix
(
c
(
+3.60
,
-1.00
,
+3.30
,
-9.10
,
-0.90
,
+3.00
,
Xtran
<-
matrix
(
c
(
+3.60
,
-1.00
,
+3.30
,
-9.10
,
-0.90
,
+3.00
,
+3.90
,
-0.50
,
+4.10
,
-8.70
,
+0.10
,
+4.00
,
+3.90
,
-0.50
,
+4.10
,
-8.70
,
+0.10
,
+4.00
,
+4.50
,
+0.50
,
+5.00
,
-8.10
,
+1.10
,
+5.00
),
+4.50
,
+0.50
,
+5.00
,
-8.10
,
+1.10
,
+5.00
),
ncol
=
6
,
byrow
=
TRUE
)
ncol
=
6
,
byrow
=
TRUE
)
Xr
eal
<-
TransfoParam_GR6J
(
ParamIn
=
Xtran
,
Direction
=
"TR"
)
Xr
aw
<-
TransfoParam_GR6J
(
ParamIn
=
Xtran
,
Direction
=
"TR"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment