First version: 17-02-2022
Pacotes e diretório
## dplyr lubridate lattice maptools ncdf4 openair ggplot2 knitr
## TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## tidyr magrittr lattice
## TRUE TRUE TRUE
Diretório de trabalho e scripts
wd <- "/home/guilherme/Documents/BAM/R"
setwd(wd)
dir_out_bam <- "/home/guilherme/Documents/BAM/data_in/bam/"
# source("~/Inland/scriptsR/plot_GRID/plot_AUX_infile.R")
# source("~/Inland/scriptsR/plot_GRID/plot_soil_infile.R")
source("~/Documents/BAM/Rsource/plot_one_point_grid.R")## ------------------------------------------------------------------------------
## You have loaded plyr after dplyr - this is likely to cause problems.
## If you need functions from both plyr and dplyr, please load plyr first, then dplyr:
## library(plyr); library(dplyr)
## ------------------------------------------------------------------------------
##
## Attaching package: 'plyr'
## The following objects are masked from 'package:dplyr':
##
## arrange, count, desc, failwith, id, mutate, rename, summarise,
## summarize
source("~/Documents/BAM/Rsource/plot_ts_BAM.R")
# source("~/Inland/scriptsR/plot_GRID/plot_one_time_allgrid.R")
# source("~/Inland/scriptsR/plot_GRID/multiplot.R")## este arquivo corresponde aos dados de JAN-2017, 3 em 3hs
file_out_day <- paste0(dir_out_bam, "SMA_2016010112-2017010112.nc4")
nc.d <- nc_open(filename = file_out_day, verbose = F)
#str(nc.d)
names(nc.d)## [1] "filename" "writable" "id" "error" "safemode"
## [6] "format" "is_GMT" "groups" "fqgn2Rindex" "ndims"
## [11] "natts" "dim" "unlimdimid" "nvars" "var"
## [1] "sp" "u" "v" "prmsl" "t" "q" "tp" "acpcp" "pwat"
## [10] "shtfl" "lhtfl" "dlwrf" "ulwrf" "nlwrt" "dswrf" "uswrf" "nswrt" "2t"
## [19] "q_2" "10u" "10v"
## NULL
## NULL
## NULL
## NULL
## NULL
## NULL
## NULL
## [1] 0 3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48 51
## [19] 54 57 60 63 66 69 72 75 78 81 84 87 90 93 96 99 102 105
## [37] 108 111 114 117 120 123 126 129 132 135 138 141 144 147 150 153 156 159
## [55] 162 165 168 171 174 177 180 183 186 189 192 195 198 201 204 207 210 213
## [73] 216 219 222 225 228 231 234 237 240 243 246 249 252 255 258 261 264 267
## [91] 270 273 276 279 282 285 288 291 294 297 300 303 306 309 312 315 318 321
## [109] 324 327 330 333 336 339 342 345 348 351 354 357 360 363 366 369 372 375
## [127] 378 381 384 387 390 393 396 399 402 405 408 411 414 417 420 423 426 429
## [145] 432 435 438 441 444 447 450 453 456 459 462 465 468 471 474 477 480 483
## [163] 486 489 492 495 498 501 504 507 510 513 516 519 522 525 528 531 534 537
## [181] 540 543 546 549 552 555 558 561 564 567 570 573 576 579 582 585 588 591
## [199] 594 597 600 603 606 609 612 615 618 621 624 627 630 633 636 639 642 645
## [217] 648 651 654 657 660 663 666 669 672 675 678 681 684 687 690 693 696 699
## [235] 702 705 708 711 714 717 720 723 726 729 732 735 738 741
## [1] 248
## [1] "hours since 2017-1-1 15:00:00"
Os dados no arquivo “SMA_2016010112-2017010112.nc4” correspondem aos dados do BAM de JAN-2017, de 3 em 3hs, iniciando as 15:00:00hs.
## [1] 132.0234833 149.6313782 139.2505951 46.3552246 34.4187775 22.8021088
## [7] 15.8628693 96.1457214 201.6800385 213.0540924 135.9007263 58.7165222
## [13] 35.8096313 23.3972168 19.3702850 55.3323669 139.8953400 168.8359528
## [19] 105.4092102 46.8980713 29.4365692 14.8053131 5.2523651 41.8327484
## [25] 119.8551788 160.0198212 106.2930756 44.4172058 29.4250793 17.0559540
## [31] 11.8094177 39.9219971 99.4942474 143.7543182 96.5406799 47.0559998
## [37] 36.0064087 23.7772675 10.9604950 41.4265747 106.7123718 134.5568390
## [43] 88.0807648 45.1386108 34.2350616 22.7465210 11.6967621 37.2810974
## [49] 100.4193878 129.2049255 86.4262695 43.4358368 31.2453461 24.3080597
## [55] 14.0767517 42.1221466 99.0948639 105.8942871 69.6714325 33.3877258
## [61] 27.6054382 19.9992981 13.5842285 41.3654938 84.4745483 93.7534332
## [67] 64.8652039 34.4621582 27.0198975 23.0814362 13.0176392 41.6584778
## [73] 77.7572479 98.7212830 71.4916229 38.0512848 36.9413452 24.9335480
## [79] 19.8219299 44.1591949 88.2338867 94.7073669 65.4356232 42.2453766
## [85] 40.6561279 26.8916626 29.8922882 103.4421387 137.7630768 207.6796722
## [91] 186.0049286 53.5545044 37.4710693 20.8410492 14.8094330 75.7956848
## [97] 232.4626923 178.6516113 172.5795135 53.5293579 14.9769440 6.8350067
## [103] 11.0957489 46.5904999 121.0740051 202.2311707 143.5193634 64.3280945
## [109] 30.2079315 16.2635803 16.4152069 57.7672882 138.5511322 183.7585602
## [115] 117.6403351 64.4586029 41.7089691 24.6871185 14.1631622 59.9015045
## [121] 141.5202942 144.5610352 104.7101288 73.1408081 49.9693146 30.7757721
## [127] 18.9707184 62.5002136 176.2383728 216.0911560 138.0605011 66.7271881
## [133] 38.9700775 22.1793518 15.8443604 67.2258759 169.8992157 195.9087372
## [139] 121.8094788 63.6152191 41.9447632 19.1229706 9.1528625 54.0086212
## [145] 147.7274170 169.3921356 103.5555267 50.5914917 40.2435455 25.5481262
## [151] 13.4019775 47.0207214 102.8509521 123.4288330 91.6858978 47.0477753
## [157] 37.1825867 22.8339081 12.5653229 43.9523468 108.2158508 97.5910645
## [163] 70.7715607 43.1634369 36.4530487 22.7598419 10.7365570 45.9875488
## [169] 117.1648865 111.8273468 75.1760559 47.1822357 43.8648987 29.1019745
## [175] 16.3334808 140.4855804 121.9693604 113.9630280 62.4591980 17.3670349
## [181] 33.5013428 24.3236542 24.9675446 52.5287781 132.7083435 127.4932709
## [187] 57.0056458 57.1818390 51.8772583 16.0643311 18.9747925 130.9260712
## [193] 247.7477722 304.3027649 121.0688629 52.6657410 28.2142334 8.1370697
## [199] 3.1428070 131.1781158 306.7114868 459.6167297 263.4349365 81.2991486
## [205] 41.9075928 30.3525085 29.7601166 86.5363617 225.1594238 240.1275482
## [211] 158.0039062 73.1315918 37.9156799 17.0321198 0.9420166 65.8371429
## [217] 187.9249420 214.7299347 139.4968872 62.0727539 41.7218475 26.7289734
## [223] 13.6646729 53.1247253 161.3610535 187.5287781 118.7520752 60.8440704
## [229] 41.4314117 26.9665680 15.3393250 59.1173096 155.5290222 172.8017883
## [235] 113.0414581 57.4247894 40.2044373 29.1970825 19.6564484 64.4403229
## [241] 160.1302795 155.2445221 75.3048401 44.5668182 41.8916168 30.5855713
## [247] 29.9526520 67.5719604
## [1] 248
Temos as seguintes variáveis (conforme email do Dirceu):
vars_bam <- c("sp: surface pressure",
"u: U component of wind",
"v: V component of wind",
"prmsl: Pressure reduce to MSL",
"t: Temperature",
"q: Specific Humidity",
"tp: Total precipitation",
"acpcp: Convective precipitation (water)",
"pwat: precipitable water",
"shtfl: sensible heat net flux",
"lhtfl: latente heat net flux",
"dlwrf: downward long-wave radiation flux",
"ulwrf: upward long-wave radiation flux",
"nlwrt: net long-wave radiation flux (top of atmosphere)",
"dswrf: downward short-wave radiation flux",
"uswrf: upward short-wave radiation flux",
"nswrt: net short-wave radiation flux (top of atmosphere)",
"2t: ?",
"q_2: ?",
"10u: ?",
"10v: ?" )
df_vars <- data.frame(BAM = vars_bam)
knitr::kable(df_vars)| BAM |
|---|
| sp: surface pressure |
| u: U component of wind |
| v: V component of wind |
| prmsl: Pressure reduce to MSL |
| t: Temperature |
| q: Specific Humidity |
| tp: Total precipitation |
| acpcp: Convective precipitation (water) |
| pwat: precipitable water |
| shtfl: sensible heat net flux |
| lhtfl: latente heat net flux |
| dlwrf: downward long-wave radiation flux |
| ulwrf: upward long-wave radiation flux |
| nlwrt: net long-wave radiation flux (top of atmosphere) |
| dswrf: downward short-wave radiation flux |
| uswrf: upward short-wave radiation flux |
| nswrt: net short-wave radiation flux (top of atmosphere) |
| 2t: ? |
| q_2: ? |
| 10u: ? |
| 10v: ? |
E as variávies observadas (torres):
sm.torre <- readRDS("/home/guilherme/Documents/BAM/data_out/torre_SM_3hr_2017_2021.rds")
names(sm.torre)## [1] "date" "Rn_f" "SWout" "LE_orig" "H_orig" "Fg_f" "Rg_f"
## [8] "Tair_f" "VPD_f"
vars_torres <- c("date: data",
"Rn_f: net radiation",
"SWout: solar radiation reflected by the surface",
"LE_orig: latent heat flux",
"H_orig: sensible heat flux",
"Fg_f: soil heat flux",
"Rg_f: global radiation",
"Tair_f: air temperature",
"VPD_f: vapor pressure deficit " )
vars_torres## [1] "date: data"
## [2] "Rn_f: net radiation"
## [3] "SWout: solar radiation reflected by the surface"
## [4] "LE_orig: latent heat flux"
## [5] "H_orig: sensible heat flux"
## [6] "Fg_f: soil heat flux"
## [7] "Rg_f: global radiation"
## [8] "Tair_f: air temperature"
## [9] "VPD_f: vapor pressure deficit "
## # A tibble: 6 × 9
## date Rn_f SWout LE_orig H_orig Fg_f Rg_f Tair_f VPD_f
## <dttm> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 2017-01-01 00:00:00 -33.6 NaN 9.86 9.36 -0.916 0 22.4 2.07
## 2 2017-01-01 03:00:00 -35.9 NaN -4.21 -17.2 -3.08 0.311 21.8 1.38
## 3 2017-01-01 06:00:00 107. NaN 62.2 15.9 -2.19 257. 25.7 6.26
## 4 2017-01-01 09:00:00 494. NaN 189. 88.8 6.25 716. 29.4 11.4
## 5 2017-01-01 12:00:00 559. NaN 295. 98.8 17.2 852. 32.2 16.9
## 6 2017-01-01 15:00:00 290. NaN 175. 36.7 18.7 461. 31.9 17.0
## # A tibble: 14,600 × 1
## LE_orig
## <dbl>
## 1 9.86
## 2 -4.21
## 3 62.2
## 4 189.
## 5 295.
## 6 175.
## 7 31.8
## 8 -7.78
## 9 1.98
## 10 9.65
## # … with 14,590 more rows
## # A tibble: 30 × 9
## date Rn_f SWout LE_orig H_orig Fg_f Rg_f Tair_f VPD_f
## <dttm> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 2017-01-01 00:00:00 -33.6 NaN 9.86 9.36 -0.916 0 22.4 2.07
## 2 2017-01-01 03:00:00 -35.9 NaN -4.21 -17.2 -3.08 0.311 21.8 1.38
## 3 2017-01-01 06:00:00 107. NaN 62.2 15.9 -2.19 257. 25.7 6.26
## 4 2017-01-01 09:00:00 494. NaN 189. 88.8 6.25 716. 29.4 11.4
## 5 2017-01-01 12:00:00 559. NaN 295. 98.8 17.2 852. 32.2 16.9
## 6 2017-01-01 15:00:00 290. NaN 175. 36.7 18.7 461. 31.9 17.0
## 7 2017-01-01 18:00:00 49.4 NaN 31.8 -6.30 12.3 68.0 24.9 2.88
## 8 2017-01-01 21:00:00 -31.8 NaN -7.78 -14.9 3.89 1.63 24.4 0.766
## 9 2017-01-02 00:00:00 -28.1 NaN 1.98 -22.1 1.52 0 24.2 2.25
## 10 2017-01-02 03:00:00 -26.7 NaN 9.65 -29.4 1.01 0.227 23.5 1.57
## # … with 20 more rows
## # A tibble: 4 × 1
## LE_orig
## <dbl>
## 1 62.2
## 2 189.
## 3 295.
## 4 175.
Função para plotar série temporal de UM ponto de grade
## Warning: `data_frame()` was deprecated in tibble 1.1.0.
## Please use `tibble()` instead.
nc.path = "~/Documents/BAM/data_in/bam/SMA_2016010112-2017010112.nc4"
var.name.bam= "lhtfl"
var.name.obs = "LE_orig"
nc.file <- nc_open(filename = nc.path, verbose = F)
time_3h <- seq(ymd_hm("2017-1-1 09:00"), ymd_hm("2017-2-1 06:00"), by = "3 hour")
#time_3h
length(time_3h)## [1] 248
gvar <- ncvar_get(nc.file, var.name.bam) #transposta array
nc_close(nc.file)
df <- data.frame(date=time_3h, bam=gvar, torre = sm.torre[4:251, var.name.obs])
df## date bam LE_orig
## 1 2017-01-01 09:00:00 132.0234833 189.33000000
## 2 2017-01-01 12:00:00 149.6313782 294.51000000
## 3 2017-01-01 15:00:00 139.2505951 174.53166667
## 4 2017-01-01 18:00:00 46.3552246 31.75291500
## 5 2017-01-01 21:00:00 34.4187775 -7.77804400
## 6 2017-01-02 00:00:00 22.8021088 1.97800000
## 7 2017-01-02 03:00:00 15.8628693 9.64616667
## 8 2017-01-02 06:00:00 96.1457214 66.17529000
## 9 2017-01-02 09:00:00 201.6800385 299.94333333
## 10 2017-01-02 12:00:00 213.0540924 265.70000000
## 11 2017-01-02 15:00:00 135.9007263 169.06666667
## 12 2017-01-02 18:00:00 58.7165222 57.09100000
## 13 2017-01-02 21:00:00 35.8096313 13.77175000
## 14 2017-01-03 00:00:00 23.3972168 4.60777833
## 15 2017-01-03 03:00:00 19.3702850 -6.95650000
## 16 2017-01-03 06:00:00 55.3323669 68.77670000
## 17 2017-01-03 09:00:00 139.8953400 283.80000000
## 18 2017-01-03 12:00:00 168.8359528 358.45166667
## 19 2017-01-03 15:00:00 105.4092102 224.05833333
## 20 2017-01-03 18:00:00 46.8980713 57.27375000
## 21 2017-01-03 21:00:00 29.4365692 62.56450000
## 22 2017-01-04 00:00:00 14.8053131 28.65083333
## 23 2017-01-04 03:00:00 5.2523651 23.30800000
## 24 2017-01-04 06:00:00 41.8327484 72.45066667
## 25 2017-01-04 09:00:00 119.8551788 210.25833333
## 26 2017-01-04 12:00:00 160.0198212 140.89600000
## 27 2017-01-04 15:00:00 106.2930756 198.28500000
## 28 2017-01-04 18:00:00 44.4172058 97.52025000
## 29 2017-01-04 21:00:00 29.4250793 -2.99431400
## 30 2017-01-05 00:00:00 17.0559540 NaN
## 31 2017-01-05 03:00:00 11.8094177 -31.84300000
## 32 2017-01-05 06:00:00 39.9219971 31.64368000
## 33 2017-01-05 09:00:00 99.4942474 139.42000000
## 34 2017-01-05 12:00:00 143.7543182 131.83700000
## 35 2017-01-05 15:00:00 96.5406799 88.82425000
## 36 2017-01-05 18:00:00 47.0559998 50.79410333
## 37 2017-01-05 21:00:00 36.0064087 14.41165000
## 38 2017-01-06 00:00:00 23.7772675 15.02694000
## 39 2017-01-06 03:00:00 10.9604950 53.26116667
## 40 2017-01-06 06:00:00 41.4265747 51.44283333
## 41 2017-01-06 09:00:00 106.7123718 191.43500000
## 42 2017-01-06 12:00:00 134.5568390 250.12666667
## 43 2017-01-06 15:00:00 88.0807648 167.65166667
## 44 2017-01-06 18:00:00 45.1386108 66.40066667
## 45 2017-01-06 21:00:00 34.2350616 27.14883333
## 46 2017-01-07 00:00:00 22.7465210 13.28991667
## 47 2017-01-07 03:00:00 11.6967621 10.08176667
## 48 2017-01-07 06:00:00 37.2810974 46.10850000
## 49 2017-01-07 09:00:00 100.4193878 126.83500000
## 50 2017-01-07 12:00:00 129.2049255 174.44666667
## 51 2017-01-07 15:00:00 86.4262695 178.92800000
## 52 2017-01-07 18:00:00 43.4358368 24.60090000
## 53 2017-01-07 21:00:00 31.2453461 -3.44047500
## 54 2017-01-08 00:00:00 24.3080597 NaN
## 55 2017-01-08 03:00:00 14.0767517 -15.01500000
## 56 2017-01-08 06:00:00 42.1221466 67.18880000
## 57 2017-01-08 09:00:00 99.0948639 174.42200000
## 58 2017-01-08 12:00:00 105.8942871 119.76775000
## 59 2017-01-08 15:00:00 69.6714325 123.95800000
## 60 2017-01-08 18:00:00 33.3877258 32.42501667
## 61 2017-01-08 21:00:00 27.6054382 116.35525000
## 62 2017-01-09 00:00:00 19.9992981 6.31445000
## 63 2017-01-09 03:00:00 13.5842285 NaN
## 64 2017-01-09 06:00:00 41.3654938 40.22720000
## 65 2017-01-09 09:00:00 84.4745483 77.82160000
## 66 2017-01-09 12:00:00 93.7534332 203.93733333
## 67 2017-01-09 15:00:00 64.8652039 277.36666667
## 68 2017-01-09 18:00:00 34.4621582 55.54862500
## 69 2017-01-09 21:00:00 27.0198975 26.94700000
## 70 2017-01-10 00:00:00 23.0814362 46.02140000
## 71 2017-01-10 03:00:00 13.0176392 NaN
## 72 2017-01-10 06:00:00 41.6584778 120.24000000
## 73 2017-01-10 09:00:00 77.7572479 161.36550000
## 74 2017-01-10 12:00:00 98.7212830 208.84666667
## 75 2017-01-10 15:00:00 71.4916229 181.28833333
## 76 2017-01-10 18:00:00 38.0512848 47.25285000
## 77 2017-01-10 21:00:00 36.9413452 5.49332500
## 78 2017-01-11 00:00:00 24.9335480 -197.23000000
## 79 2017-01-11 03:00:00 19.8219299 30.01880000
## 80 2017-01-11 06:00:00 44.1591949 77.96500000
## 81 2017-01-11 09:00:00 88.2338867 265.71833333
## 82 2017-01-11 12:00:00 94.7073669 445.54166667
## 83 2017-01-11 15:00:00 65.4356232 338.61833333
## 84 2017-01-11 18:00:00 42.2453766 92.91921667
## 85 2017-01-11 21:00:00 40.6561279 34.67293333
## 86 2017-01-12 00:00:00 26.8916626 11.92670000
## 87 2017-01-12 03:00:00 29.8922882 2.96636333
## 88 2017-01-12 06:00:00 103.4421387 70.07825000
## 89 2017-01-12 09:00:00 137.7630768 285.10000000
## 90 2017-01-12 12:00:00 207.6796722 475.23600000
## 91 2017-01-12 15:00:00 186.0049286 378.11000000
## 92 2017-01-12 18:00:00 53.5545044 76.49166667
## 93 2017-01-12 21:00:00 37.4710693 2.20802250
## 94 2017-01-13 00:00:00 20.8410492 -10.92283333
## 95 2017-01-13 03:00:00 14.8094330 NaN
## 96 2017-01-13 06:00:00 75.7956848 56.00740000
## 97 2017-01-13 09:00:00 232.4626923 256.21000000
## 98 2017-01-13 12:00:00 178.6516113 387.96333333
## 99 2017-01-13 15:00:00 172.5795135 274.72166667
## 100 2017-01-13 18:00:00 53.5293579 77.15752000
## 101 2017-01-13 21:00:00 14.9769440 -1.67703667
## 102 2017-01-14 00:00:00 6.8350067 -13.07850000
## 103 2017-01-14 03:00:00 11.0957489 22.70065000
## 104 2017-01-14 06:00:00 46.5904999 77.66025000
## 105 2017-01-14 09:00:00 121.0740051 200.40333333
## 106 2017-01-14 12:00:00 202.2311707 142.57500000
## 107 2017-01-14 15:00:00 143.5193634 78.18666667
## 108 2017-01-14 18:00:00 64.3280945 37.02535000
## 109 2017-01-14 21:00:00 30.2079315 -0.03783333
## 110 2017-01-15 00:00:00 16.2635803 9.31488000
## 111 2017-01-15 03:00:00 16.4152069 8.18627500
## 112 2017-01-15 06:00:00 57.7672882 49.58366667
## 113 2017-01-15 09:00:00 138.5511322 315.37666667
## 114 2017-01-15 12:00:00 183.7585602 416.54166667
## 115 2017-01-15 15:00:00 117.6403351 225.75166667
## 116 2017-01-15 18:00:00 64.4586029 51.50216667
## 117 2017-01-15 21:00:00 41.7089691 38.95050000
## 118 2017-01-16 00:00:00 24.6871185 19.50470000
## 119 2017-01-16 03:00:00 14.1631622 66.43033333
## 120 2017-01-16 06:00:00 59.9015045 36.20300000
## 121 2017-01-16 09:00:00 141.5202942 134.34325000
## 122 2017-01-16 12:00:00 144.5610352 254.62500000
## 123 2017-01-16 15:00:00 104.7101288 226.77500000
## 124 2017-01-16 18:00:00 73.1408081 56.76783333
## 125 2017-01-16 21:00:00 49.9693146 34.25900000
## 126 2017-01-17 00:00:00 30.7757721 20.54190000
## 127 2017-01-17 03:00:00 18.9707184 16.53052500
## 128 2017-01-17 06:00:00 62.5002136 58.82580000
## 129 2017-01-17 09:00:00 176.2383728 188.54500000
## 130 2017-01-17 12:00:00 216.0911560 228.76166667
## 131 2017-01-17 15:00:00 138.0605011 199.94833333
## 132 2017-01-17 18:00:00 66.7271881 57.91690000
## 133 2017-01-17 21:00:00 38.9700775 6.11166500
## 134 2017-01-18 00:00:00 22.1793518 -0.49382000
## 135 2017-01-18 03:00:00 15.8443604 -8.80560000
## 136 2017-01-18 06:00:00 67.2258759 85.82975000
## 137 2017-01-18 09:00:00 169.8992157 237.03333333
## 138 2017-01-18 12:00:00 195.9087372 434.75000000
## 139 2017-01-18 15:00:00 121.8094788 377.92500000
## 140 2017-01-18 18:00:00 63.6152191 87.77883333
## 141 2017-01-18 21:00:00 41.9447632 -13.26912000
## 142 2017-01-19 00:00:00 19.1229706 13.72937500
## 143 2017-01-19 03:00:00 9.1528625 -5.44596833
## 144 2017-01-19 06:00:00 54.0086212 56.03103333
## 145 2017-01-19 09:00:00 147.7274170 309.17166667
## 146 2017-01-19 12:00:00 169.3921356 520.49166667
## 147 2017-01-19 15:00:00 103.5555267 411.61666667
## 148 2017-01-19 18:00:00 50.5914917 84.51716667
## 149 2017-01-19 21:00:00 40.2435455 33.87950000
## 150 2017-01-20 00:00:00 25.5481262 5.14675000
## 151 2017-01-20 03:00:00 13.4019775 -13.67560000
## 152 2017-01-20 06:00:00 47.0207214 51.05950333
## 153 2017-01-20 09:00:00 102.8509521 275.65333333
## 154 2017-01-20 12:00:00 123.4288330 497.68333333
## 155 2017-01-20 15:00:00 91.6858978 364.92500000
## 156 2017-01-20 18:00:00 47.0477753 78.32073333
## 157 2017-01-20 21:00:00 37.1825867 26.03283333
## 158 2017-01-21 00:00:00 22.8339081 9.12419833
## 159 2017-01-21 03:00:00 12.5653229 -0.00480000
## 160 2017-01-21 06:00:00 43.9523468 66.22450000
## 161 2017-01-21 09:00:00 108.2158508 274.36000000
## 162 2017-01-21 12:00:00 97.5910645 440.11333333
## 163 2017-01-21 15:00:00 70.7715607 359.36500000
## 164 2017-01-21 18:00:00 43.1634369 77.81950000
## 165 2017-01-21 21:00:00 36.4530487 26.53500000
## 166 2017-01-22 00:00:00 22.7598419 -0.32543333
## 167 2017-01-22 03:00:00 10.7365570 17.53200000
## 168 2017-01-22 06:00:00 45.9875488 41.37733333
## 169 2017-01-22 09:00:00 117.1648865 248.43500000
## 170 2017-01-22 12:00:00 111.8273468 472.12333333
## 171 2017-01-22 15:00:00 75.1760559 339.07000000
## 172 2017-01-22 18:00:00 47.1822357 73.70190410
## 173 2017-01-22 21:00:00 43.8648987 25.52690000
## 174 2017-01-23 00:00:00 29.1019745 1.64925000
## 175 2017-01-23 03:00:00 16.3334808 3.74225000
## 176 2017-01-23 06:00:00 140.4855804 55.80300000
## 177 2017-01-23 09:00:00 121.9693604 255.76833333
## 178 2017-01-23 12:00:00 113.9630280 428.61666667
## 179 2017-01-23 15:00:00 62.4591980 211.20833333
## 180 2017-01-23 18:00:00 17.3670349 52.28152000
## 181 2017-01-23 21:00:00 33.5013428 0.00325000
## 182 2017-01-24 00:00:00 24.3236542 -14.37850200
## 183 2017-01-24 03:00:00 24.9675446 -59.32500000
## 184 2017-01-24 06:00:00 52.5287781 46.18718333
## 185 2017-01-24 09:00:00 132.7083435 264.58666667
## 186 2017-01-24 12:00:00 127.4932709 382.53666667
## 187 2017-01-24 15:00:00 57.0056458 17.98580000
## 188 2017-01-24 18:00:00 57.1818390 -9.15093333
## 189 2017-01-24 21:00:00 51.8772583 4.42492500
## 190 2017-01-25 00:00:00 16.0643311 1.63932500
## 191 2017-01-25 03:00:00 18.9747925 NaN
## 192 2017-01-25 06:00:00 130.9260712 88.57375000
## 193 2017-01-25 09:00:00 247.7477722 194.26000000
## 194 2017-01-25 12:00:00 304.3027649 267.69600000
## 195 2017-01-25 15:00:00 121.0688629 281.38150000
## 196 2017-01-25 18:00:00 52.6657410 73.76900000
## 197 2017-01-25 21:00:00 28.2142334 -2.34840000
## 198 2017-01-26 00:00:00 8.1370697 10.33023250
## 199 2017-01-26 03:00:00 3.1428070 2.04067820
## 200 2017-01-26 06:00:00 131.1781158 71.50875000
## 201 2017-01-26 09:00:00 306.7114868 161.96833333
## 202 2017-01-26 12:00:00 459.6167297 273.58333333
## 203 2017-01-26 15:00:00 263.4349365 214.37480000
## 204 2017-01-26 18:00:00 81.2991486 64.90033333
## 205 2017-01-26 21:00:00 41.9075928 -13.06428667
## 206 2017-01-27 00:00:00 30.3525085 2.11296000
## 207 2017-01-27 03:00:00 29.7601166 NaN
## 208 2017-01-27 06:00:00 86.5363617 68.13790000
## 209 2017-01-27 09:00:00 225.1594238 236.20833333
## 210 2017-01-27 12:00:00 240.1275482 309.09000000
## 211 2017-01-27 15:00:00 158.0039062 275.09833333
## 212 2017-01-27 18:00:00 73.1315918 81.34823333
## 213 2017-01-27 21:00:00 37.9156799 9.53345000
## 214 2017-01-28 00:00:00 17.0321198 NaN
## 215 2017-01-28 03:00:00 0.9420166 9.90680000
## 216 2017-01-28 06:00:00 65.8371429 47.06412000
## 217 2017-01-28 09:00:00 187.9249420 273.68666667
## 218 2017-01-28 12:00:00 214.7299347 453.88333333
## 219 2017-01-28 15:00:00 139.4968872 378.35833333
## 220 2017-01-28 18:00:00 62.0727539 65.77150000
## 221 2017-01-28 21:00:00 41.7218475 7.86260000
## 222 2017-01-29 00:00:00 26.7289734 0.58574050
## 223 2017-01-29 03:00:00 13.6646729 -9.17770000
## 224 2017-01-29 06:00:00 53.1247253 91.40975000
## 225 2017-01-29 09:00:00 161.3610535 261.85500000
## 226 2017-01-29 12:00:00 187.5287781 483.09800000
## 227 2017-01-29 15:00:00 118.7520752 309.96666667
## 228 2017-01-29 18:00:00 60.8440704 85.96233333
## 229 2017-01-29 21:00:00 41.4314117 9.98261667
## 230 2017-01-30 00:00:00 26.9665680 8.85790000
## 231 2017-01-30 03:00:00 15.3393250 -4.98636667
## 232 2017-01-30 06:00:00 59.1173096 17.11194000
## 233 2017-01-30 09:00:00 155.5290222 188.26333333
## 234 2017-01-30 12:00:00 172.8017883 287.17000000
## 235 2017-01-30 15:00:00 113.0414581 258.35750000
## 236 2017-01-30 18:00:00 57.4247894 64.52180000
## 237 2017-01-30 21:00:00 40.2044373 -3.31293400
## 238 2017-01-31 00:00:00 29.1970825 -9.97275000
## 239 2017-01-31 03:00:00 19.6564484 -0.12352800
## 240 2017-01-31 06:00:00 64.4403229 46.98005088
## 241 2017-01-31 09:00:00 160.1302795 254.19166667
## 242 2017-01-31 12:00:00 155.2445221 346.75333333
## 243 2017-01-31 15:00:00 75.3048401 165.47050000
## 244 2017-01-31 18:00:00 44.5668182 31.02202500
## 245 2017-01-31 21:00:00 41.8916168 3.90764000
## 246 2017-02-01 00:00:00 30.5855713 2.95126667
## 247 2017-02-01 03:00:00 29.9526520 2.65344000
## 248 2017-02-01 06:00:00 67.5719604 67.03240000
cores.basic <- c("blue", "red")
RMSE <- hydroGOF::rmse(df$bam, df[, var.name.obs], na.rm=T)
# plot time series
df %>% gather(vars, value, -date) %>%
mutate(vars = factor(vars, levels = c(var.name.obs, "bam"))) %>% #legenda na ordem correta!
ggplot(aes(x = date, y = value, colour = vars)) +
geom_line(aes(linetype=vars), size = 0.8) + theme_bw() +
scale_y_continuous(name = expression(W~m^{-2})) +
scale_x_datetime(name = element_blank(),
date_breaks = "day", date_labels = "%d\n%b", expand = c(0,0)) + #"%b\n%Y"
scale_color_manual(values = cores.basic) +
scale_linetype_manual(values=c("solid","longdash")) + # Change linetypes
theme(legend.title = element_blank(), legend.position = c(0.2, 0.85),
legend.key=element_blank() , legend.direction = "horizontal",
axis.text=element_text(size=12, face="bold"),
axis.title=element_text(size=14,face="bold"),
legend.text=element_text(size=14)) +
annotate(geom = "text",x =as.POSIXct("2017-01-30"), y = 300,
label = paste0("RMSE=", round(RMSE, 2)), size = 5,col = "black" )var.name.bam = "shtfl"
var.name.obs = "H_orig"
nc.file <- nc_open(filename = nc.path, verbose = F)
gvar <- ncvar_get(nc.file, var.name.bam) #transposta array
nc_close(nc.file)
df <- data.frame(date=time_3h, bam = gvar, torre = sm.torre[4:251, var.name.obs])
df## date bam H_orig
## 1 2017-01-01 09:00:00 229.7846832 88.7978333
## 2 2017-01-01 12:00:00 254.1694336 98.7813333
## 3 2017-01-01 15:00:00 129.5083008 36.6571667
## 4 2017-01-01 18:00:00 2.7270508 -6.2959600
## 5 2017-01-01 21:00:00 -9.6328125 -14.9405400
## 6 2017-01-02 00:00:00 -8.6017609 -22.1188400
## 7 2017-01-02 03:00:00 -5.4406738 -29.3520333
## 8 2017-01-02 06:00:00 67.5069733 22.8266200
## 9 2017-01-02 09:00:00 277.0347290 117.5288333
## 10 2017-01-02 12:00:00 355.1858521 91.0358333
## 11 2017-01-02 15:00:00 218.5041046 58.0815000
## 12 2017-01-02 18:00:00 9.8925323 -15.3312000
## 13 2017-01-02 21:00:00 -8.2100983 -21.0065000
## 14 2017-01-03 00:00:00 -6.3421478 -22.3645000
## 15 2017-01-03 03:00:00 -4.3761902 -10.9734667
## 16 2017-01-03 06:00:00 104.3052216 29.7553667
## 17 2017-01-03 09:00:00 287.9510803 121.2195000
## 18 2017-01-03 12:00:00 341.3803711 99.4371667
## 19 2017-01-03 15:00:00 196.9227448 24.8322833
## 20 2017-01-03 18:00:00 0.1352692 -19.0703250
## 21 2017-01-03 21:00:00 -13.5226746 -17.6227500
## 22 2017-01-04 00:00:00 -9.6296082 -28.0193333
## 23 2017-01-04 03:00:00 -3.6340332 -31.5431000
## 24 2017-01-04 06:00:00 87.2514648 -4.1210167
## 25 2017-01-04 09:00:00 269.4631348 97.0883333
## 26 2017-01-04 12:00:00 335.0686035 -9.9265140
## 27 2017-01-04 15:00:00 195.9011230 23.5758667
## 28 2017-01-04 18:00:00 -6.0161133 17.4995600
## 29 2017-01-04 21:00:00 -17.8012695 -12.5703800
## 30 2017-01-05 00:00:00 -12.2050781 -49.7364667
## 31 2017-01-05 03:00:00 -8.6596680 -14.3103800
## 32 2017-01-05 06:00:00 82.1367188 19.0034600
## 33 2017-01-05 09:00:00 222.1665039 41.4621333
## 34 2017-01-05 12:00:00 315.7830811 -21.0832000
## 35 2017-01-05 15:00:00 191.2145996 -1.2064775
## 36 2017-01-05 18:00:00 -5.5847168 -6.6938000
## 37 2017-01-05 21:00:00 -20.5435791 -6.2302250
## 38 2017-01-06 00:00:00 -16.3532715 -9.5469667
## 39 2017-01-06 03:00:00 -7.9887543 -32.0593333
## 40 2017-01-06 06:00:00 85.7121124 1.7319600
## 41 2017-01-06 09:00:00 247.0288544 86.3738333
## 42 2017-01-06 12:00:00 310.7271423 138.7853333
## 43 2017-01-06 15:00:00 181.9912109 59.4320000
## 44 2017-01-06 18:00:00 -10.7397919 -13.3990000
## 45 2017-01-06 21:00:00 -28.3864594 -37.7885000
## 46 2017-01-07 00:00:00 -20.7478943 -19.8235000
## 47 2017-01-07 03:00:00 -10.4223785 -12.3633167
## 48 2017-01-07 06:00:00 91.2412872 20.6138500
## 49 2017-01-07 09:00:00 248.7508240 68.7351667
## 50 2017-01-07 12:00:00 310.2415161 71.2818333
## 51 2017-01-07 15:00:00 178.9218445 66.5211667
## 52 2017-01-07 18:00:00 -13.1195831 6.6873460
## 53 2017-01-07 21:00:00 -26.3465424 -25.7791833
## 54 2017-01-08 00:00:00 -21.7225342 -17.4034333
## 55 2017-01-08 03:00:00 -16.3312225 -1.8154000
## 56 2017-01-08 06:00:00 102.3172455 7.0732000
## 57 2017-01-08 09:00:00 257.5894775 43.9413333
## 58 2017-01-08 12:00:00 284.7452087 32.4685000
## 59 2017-01-08 15:00:00 171.1399231 47.6405000
## 60 2017-01-08 18:00:00 -7.8327789 -2.1006333
## 61 2017-01-08 21:00:00 -20.7008820 10.2712667
## 62 2017-01-09 00:00:00 -17.6315002 -11.2903667
## 63 2017-01-09 03:00:00 -16.8125000 -60.7352000
## 64 2017-01-09 06:00:00 93.5149536 -13.4761750
## 65 2017-01-09 09:00:00 218.8362732 7.3713160
## 66 2017-01-09 12:00:00 247.2500458 -18.0723800
## 67 2017-01-09 15:00:00 158.3486328 65.4648333
## 68 2017-01-09 18:00:00 -4.1814728 13.4883333
## 69 2017-01-09 21:00:00 -19.4866486 -27.5621833
## 70 2017-01-10 00:00:00 -16.3811340 -41.4052000
## 71 2017-01-10 03:00:00 -14.5082703 -10.0853750
## 72 2017-01-10 06:00:00 80.2249603 -14.3112120
## 73 2017-01-10 09:00:00 186.9731445 53.9734000
## 74 2017-01-10 12:00:00 250.5417480 68.0271667
## 75 2017-01-10 15:00:00 159.4123535 62.7463333
## 76 2017-01-10 18:00:00 -12.9327393 6.9668800
## 77 2017-01-10 21:00:00 -23.9676056 -10.1663500
## 78 2017-01-11 00:00:00 -22.0319061 2.0337750
## 79 2017-01-11 03:00:00 -24.8438721 -5.9594400
## 80 2017-01-11 06:00:00 84.2059479 16.0172500
## 81 2017-01-11 09:00:00 224.2965698 107.3725000
## 82 2017-01-11 12:00:00 260.7567749 168.5500000
## 83 2017-01-11 15:00:00 151.5749817 117.0008000
## 84 2017-01-11 18:00:00 -6.0394745 6.3356000
## 85 2017-01-11 21:00:00 -7.1403503 -40.7594167
## 86 2017-01-12 00:00:00 -18.3567657 -27.4505500
## 87 2017-01-12 03:00:00 -20.0596619 -18.3095000
## 88 2017-01-12 06:00:00 14.7952118 11.9779333
## 89 2017-01-12 09:00:00 114.4439392 168.7483333
## 90 2017-01-12 12:00:00 87.0587616 180.2766667
## 91 2017-01-12 15:00:00 24.0922699 127.6956667
## 92 2017-01-12 18:00:00 -2.1772614 -6.3353333
## 93 2017-01-12 21:00:00 1.4279633 -32.4688000
## 94 2017-01-13 00:00:00 -1.7067719 -18.5326667
## 95 2017-01-13 03:00:00 -3.3852692 -10.9074750
## 96 2017-01-13 06:00:00 10.6231232 30.5114333
## 97 2017-01-13 09:00:00 41.5465393 112.2780000
## 98 2017-01-13 12:00:00 190.7666931 106.1508333
## 99 2017-01-13 15:00:00 60.7743683 29.5122267
## 100 2017-01-13 18:00:00 -2.9436951 -12.0801400
## 101 2017-01-13 21:00:00 -2.7046051 -1.2872250
## 102 2017-01-14 00:00:00 -0.7140198 -3.0021000
## 103 2017-01-14 03:00:00 -0.1141815 -0.8809667
## 104 2017-01-14 06:00:00 58.6122894 20.5072600
## 105 2017-01-14 09:00:00 178.6743774 59.5096667
## 106 2017-01-14 12:00:00 260.5108337 21.2183000
## 107 2017-01-14 15:00:00 170.1315155 -6.1605333
## 108 2017-01-14 18:00:00 12.9259796 -9.2799600
## 109 2017-01-14 21:00:00 -4.7075958 -15.3049150
## 110 2017-01-15 00:00:00 -0.4315796 -9.2793333
## 111 2017-01-15 03:00:00 5.6847534 -8.4889617
## 112 2017-01-15 06:00:00 90.9924927 16.5123800
## 113 2017-01-15 09:00:00 185.5849304 147.6450000
## 114 2017-01-15 12:00:00 225.1601257 148.7650000
## 115 2017-01-15 15:00:00 121.4150085 52.4603333
## 116 2017-01-15 18:00:00 -3.4695129 -17.4978833
## 117 2017-01-15 21:00:00 -5.7335510 -29.8381667
## 118 2017-01-16 00:00:00 -3.6443176 -23.8252667
## 119 2017-01-16 03:00:00 -2.4931488 -21.2688600
## 120 2017-01-16 06:00:00 85.0923462 -4.2444167
## 121 2017-01-16 09:00:00 190.5852814 -6.4686750
## 122 2017-01-16 12:00:00 156.3361816 6.2629800
## 123 2017-01-16 15:00:00 97.0346680 31.4363333
## 124 2017-01-16 18:00:00 4.1055603 2.8100667
## 125 2017-01-16 21:00:00 3.1929932 -23.1854000
## 126 2017-01-17 00:00:00 2.1142578 -5.5955200
## 127 2017-01-17 03:00:00 1.4808350 -19.0802333
## 128 2017-01-17 06:00:00 93.6001892 6.3510000
## 129 2017-01-17 09:00:00 262.4610596 80.3488333
## 130 2017-01-17 12:00:00 315.8709106 112.8758333
## 131 2017-01-17 15:00:00 186.3731689 71.3523500
## 132 2017-01-17 18:00:00 2.8467255 -9.5358600
## 133 2017-01-17 21:00:00 -6.5149078 -1.2724540
## 134 2017-01-18 00:00:00 -3.3294678 -18.8169600
## 135 2017-01-18 03:00:00 -2.0212402 -13.9322400
## 136 2017-01-18 06:00:00 123.2717285 24.7650000
## 137 2017-01-18 09:00:00 297.2827454 95.5100000
## 138 2017-01-18 12:00:00 337.4480591 138.1733333
## 139 2017-01-18 15:00:00 188.7636719 92.9981667
## 140 2017-01-18 18:00:00 -0.9558105 -4.8510000
## 141 2017-01-18 21:00:00 -9.0765533 -22.5350000
## 142 2017-01-19 00:00:00 -11.1576538 -32.3625000
## 143 2017-01-19 03:00:00 -4.3723145 -29.1120000
## 144 2017-01-19 06:00:00 112.0641022 13.3185833
## 145 2017-01-19 09:00:00 280.6804199 161.4150000
## 146 2017-01-19 12:00:00 305.2058105 220.1983333
## 147 2017-01-19 15:00:00 160.1359863 121.3198333
## 148 2017-01-19 18:00:00 -14.6547852 -22.5541333
## 149 2017-01-19 21:00:00 -21.6320801 -58.5024000
## 150 2017-01-20 00:00:00 -18.3532715 -42.5840000
## 151 2017-01-20 03:00:00 -12.7029877 -23.0816667
## 152 2017-01-20 06:00:00 87.9159241 22.3382000
## 153 2017-01-20 09:00:00 219.1260834 165.0858333
## 154 2017-01-20 12:00:00 254.9318848 208.9033333
## 155 2017-01-20 15:00:00 137.9193420 126.4685000
## 156 2017-01-20 18:00:00 -20.2192383 -13.2567667
## 157 2017-01-20 21:00:00 -28.6074219 -52.2223333
## 158 2017-01-21 00:00:00 -22.2683105 -38.6266667
## 159 2017-01-21 03:00:00 -14.5720215 -17.8676667
## 160 2017-01-21 06:00:00 90.0351257 13.2532167
## 161 2017-01-21 09:00:00 227.6960754 169.3750000
## 162 2017-01-21 12:00:00 210.9308929 190.5850000
## 163 2017-01-21 15:00:00 89.9627838 117.7700000
## 164 2017-01-21 18:00:00 -19.5146790 -17.0278000
## 165 2017-01-21 21:00:00 -30.5303040 -51.2025000
## 166 2017-01-22 00:00:00 -20.6051941 -31.6590000
## 167 2017-01-22 03:00:00 -12.5573883 -7.5309000
## 168 2017-01-22 06:00:00 94.3617859 10.3884167
## 169 2017-01-22 09:00:00 237.4994202 154.1298333
## 170 2017-01-22 12:00:00 217.9649811 198.4733333
## 171 2017-01-22 15:00:00 135.0906677 108.1893333
## 172 2017-01-22 18:00:00 -8.3118134 -1.7739833
## 173 2017-01-22 21:00:00 -19.5141907 -41.1452833
## 174 2017-01-23 00:00:00 -14.2840118 -27.3169167
## 175 2017-01-23 03:00:00 -6.7483368 -8.1280333
## 176 2017-01-23 06:00:00 24.2196198 21.2046783
## 177 2017-01-23 09:00:00 237.1032410 140.2216667
## 178 2017-01-23 12:00:00 235.1357880 164.5015000
## 179 2017-01-23 15:00:00 101.5421295 39.9273333
## 180 2017-01-23 18:00:00 -1.6226349 -12.6722000
## 181 2017-01-23 21:00:00 -9.0006256 -31.5690000
## 182 2017-01-24 00:00:00 -16.3181000 -19.0982000
## 183 2017-01-24 03:00:00 -17.6876526 -8.3077400
## 184 2017-01-24 06:00:00 75.7718506 15.3968583
## 185 2017-01-24 09:00:00 257.2982178 126.6131667
## 186 2017-01-24 12:00:00 269.9943237 93.8955000
## 187 2017-01-24 15:00:00 46.3518372 -20.6317400
## 188 2017-01-24 18:00:00 -9.8899994 -7.9959000
## 189 2017-01-24 21:00:00 -9.8710938 -4.9289780
## 190 2017-01-25 00:00:00 -3.9138184 -8.6760800
## 191 2017-01-25 03:00:00 -4.3454590 -8.5837600
## 192 2017-01-25 06:00:00 50.3669586 0.6168000
## 193 2017-01-25 09:00:00 169.0460968 79.2655000
## 194 2017-01-25 12:00:00 56.3708496 22.1083333
## 195 2017-01-25 15:00:00 13.0478516 72.6492000
## 196 2017-01-25 18:00:00 -5.5075684 -6.2167500
## 197 2017-01-25 21:00:00 -1.0620117 -6.2107600
## 198 2017-01-26 00:00:00 -0.7343750 -2.5566600
## 199 2017-01-26 03:00:00 -3.3735352 -4.7701833
## 200 2017-01-26 06:00:00 24.0956726 16.9193750
## 201 2017-01-26 09:00:00 95.0229797 74.8778333
## 202 2017-01-26 12:00:00 83.9203033 141.1775000
## 203 2017-01-26 15:00:00 26.1781158 75.6532000
## 204 2017-01-26 18:00:00 4.6626740 -10.0295167
## 205 2017-01-26 21:00:00 11.7477875 -6.5416400
## 206 2017-01-27 00:00:00 3.1163025 -8.2598833
## 207 2017-01-27 03:00:00 10.3388214 -9.0303560
## 208 2017-01-27 06:00:00 113.3848114 15.4734942
## 209 2017-01-27 09:00:00 259.9184875 142.4566667
## 210 2017-01-27 12:00:00 259.8864746 168.2948333
## 211 2017-01-27 15:00:00 122.6867676 112.9218333
## 212 2017-01-27 18:00:00 -19.8710022 -2.3452167
## 213 2017-01-27 21:00:00 -20.4724121 -9.6746600
## 214 2017-01-28 00:00:00 -9.9420471 -3.0463650
## 215 2017-01-28 03:00:00 -5.0407867 -2.5679080
## 216 2017-01-28 06:00:00 97.7946014 22.9680483
## 217 2017-01-28 09:00:00 254.0809021 178.5850000
## 218 2017-01-28 12:00:00 270.5953979 183.7983333
## 219 2017-01-28 15:00:00 143.8586731 125.2718333
## 220 2017-01-28 18:00:00 -17.8778229 9.1858333
## 221 2017-01-28 21:00:00 -24.3664703 -25.1153260
## 222 2017-01-29 00:00:00 -15.4076080 -28.0396667
## 223 2017-01-29 03:00:00 -11.4948273 -12.6291000
## 224 2017-01-29 06:00:00 82.2763062 13.4006400
## 225 2017-01-29 09:00:00 230.9681854 152.5166667
## 226 2017-01-29 12:00:00 260.4782104 185.6933333
## 227 2017-01-29 15:00:00 137.1767273 67.3520000
## 228 2017-01-29 18:00:00 -16.3400879 -17.0188450
## 229 2017-01-29 21:00:00 -21.7989960 -23.7686667
## 230 2017-01-30 00:00:00 -16.3361053 -22.4596000
## 231 2017-01-30 03:00:00 -15.9437408 -14.3034667
## 232 2017-01-30 06:00:00 89.8936005 -2.1610000
## 233 2017-01-30 09:00:00 226.6159058 72.8858333
## 234 2017-01-30 12:00:00 248.5519714 87.7652500
## 235 2017-01-30 15:00:00 130.9089813 126.1850000
## 236 2017-01-30 18:00:00 -17.4060516 -16.1229500
## 237 2017-01-30 21:00:00 -16.8477783 -11.0456200
## 238 2017-01-31 00:00:00 -18.1329956 -7.3340500
## 239 2017-01-31 03:00:00 -17.7183533 -4.4956000
## 240 2017-01-31 06:00:00 86.0240021 -2.6641833
## 241 2017-01-31 09:00:00 239.5079803 88.8353333
## 242 2017-01-31 12:00:00 239.1917419 93.7423333
## 243 2017-01-31 15:00:00 85.7252808 42.7857500
## 244 2017-01-31 18:00:00 -9.5101929 -17.6791400
## 245 2017-01-31 21:00:00 -21.7984924 -12.5142750
## 246 2017-02-01 00:00:00 -16.8659515 -0.5957667
## 247 2017-02-01 03:00:00 -13.9810181 -14.7073600
## 248 2017-02-01 06:00:00 67.2657166 -11.8447667
RMSE <- hydroGOF::rmse(df$bam, df[, var.name.obs], na.rm=T)
# plot time series
df %>% gather(vars, value, -date) %>%
mutate(vars = factor(vars, levels = c(var.name.obs, "bam"))) %>% #legenda na ordem correta!
ggplot(aes(x = date, y = value, colour = vars)) +
geom_line(aes(linetype=vars), size = 0.8) + theme_bw() +
scale_y_continuous(name = expression(W~m^{-2})) +
scale_x_datetime(name = element_blank(),
date_breaks = "day", date_labels = "%d\n%b", expand = c(0,0)) + #"%b\n%Y"
scale_color_manual(values = cores.basic) +
scale_linetype_manual(values=c("solid","longdash")) + # Change linetypes
theme(legend.title = element_blank(), legend.position = c(0.2, 0.85),
legend.key=element_blank() , legend.direction = "horizontal",
axis.text=element_text(size=12, face="bold"),
axis.title=element_text(size=14,face="bold"),
legend.text=element_text(size=14)) +
annotate(geom = "text",x =as.POSIXct("2017-01-30"), y = 300,
label = paste0("RMSE=", round(RMSE, 2)), size = 5,col = "black" )!!!!!!! T H E E N D!!!!!!!!!!!