Calculates missing values of relative humidity, radiation and potential evapotranspiration from a data frame with daily values of minimum/maximum/mean temperature and precipitation. The function takes a meteo object (with meteoland names) and complete any missing variable if it is possible

complete_meteo(meteo, verbose = getOption("meteoland_verbosity", TRUE))

Arguments

meteo

meteoland weather data

verbose

Logical indicating if the function must show messages and info. Default value checks "meteoland_verbosity" option and if not set, defaults to TRUE. It can be turned off for the function with FALSE, or session wide with options(meteoland_verbosity = FALSE)

Value

the same meteo data provided with the the variables completed

Details

#' The function fills values for humidity, radiation and PET only if they are missing in the input data frame. If a column 'SpecificHumidity' is present in the input data, relative humidity is calculated from it. Otherwise, relative humidity is calculated assuming that dew point temperature equals the minimum temperature. Potential solar radiation is calculated from latitude, slope and aspect. Incoming solar radiation is then corrected following Thornton & Running (1999) and potential evapotranspiration following Penman (1948).

References

Thornton, P.E., Running, S.W., 1999. An improved algorithm for estimating incident daily solar radiation from measurements of temperature, humidity, and precipitation. Agric. For. Meteorol. 93, 211-228.

Penman, H. L. 1948. Natural evaporation from open water, bare soil and grass. Proceedings of the Royal Society of London. Series A. Mathematical and Physical Sciences, 193, 120-145.

Author

Miquel De Cáceres Ainsa, EMF-CREAF

Victor Granda García, EMF-CREAF

Examples


# \donttest{
# example data
data("meteoland_meteo_example")

# remove MinRelativeHumidity
meteoland_meteo_example$MinRelativeHumidity <- NULL
# complete vars
completed_meteo <- complete_meteo(meteoland_meteo_example)
#>  Completing missing variables if possible:
#> • RelativeHumidity
#> • MinRelativeHumidity
#> • MaxRelativeHumidity
#> • Radiation
#>  Done
# check MinRelativeHumidity
completed_meteo$MinRelativeHumidity
#>    [1] 44.54373 43.92829 48.22623 67.79254 48.13884 52.58872 46.28775 58.60228
#>    [9] 51.51611 56.84501 53.64692 48.23087 59.62648 49.58845 57.88316 53.23507
#>   [17] 53.84621 53.40034 48.91317 52.92733 68.74477 52.08616 68.03216 56.87095
#>   [25] 60.39051 52.51741 62.26776 40.07248 54.95452 53.07458 57.86287 55.65242
#>   [33] 64.69792 43.33776 38.93237 57.42919 50.29339 51.20680 75.15707       NA
#>   [41] 43.96618       NA       NA 50.02883 52.23688 59.78000 50.26596       NA
#>   [49] 71.57516 70.23570 52.36338 54.59605 55.16370 62.14800 62.55405 57.91424
#>   [57] 45.91763 51.83501 54.45964 48.19865 48.22326 55.10691 48.67579 44.52462
#>   [65] 54.85522 33.81187 35.77014 45.24607 50.67401 60.70006 67.35221 64.69792
#>   [73] 61.93203 42.02909 45.15919 45.74066 51.67576 42.98868 49.30001 56.32064
#>   [81] 54.95100 63.97702 48.16529 51.76176 50.73038 50.31282 47.23062 36.10267
#>   [89] 61.36378 47.40498 54.67595 60.41107 52.05833 58.66030 52.33391 53.94614
#>   [97] 68.26719 70.62465 52.76273 49.02359 48.77586 46.25286 39.17402 45.04157
#>  [105] 48.30832 57.85276 39.18674 45.87876 53.42782 56.63617 46.35729 47.64460
#>  [113] 58.77477 68.16281 50.90309 53.15720 53.53502 52.97218 47.96694 43.39702
#>  [121] 59.72323 50.12385 48.01965 48.55139 48.39733 48.97666 56.52907 47.30072
#>  [129] 55.86220 62.51645 43.19242 53.40399 52.91206 47.70686 50.00823 52.13863
#>  [137] 50.57424 52.62297 56.01142 55.21709 56.03252 54.68062 48.71304 32.62901
#>  [145] 57.54887 40.97030 48.82751 51.62347 53.04135 59.13214 48.49328 53.60259
#>  [153] 46.85083 48.90796 52.69351 54.43472 41.89553 49.75447 69.66773 55.63186
#>  [161] 57.34472 53.59226 55.95172 49.39733 48.34768 47.11483 47.43683 55.11064
#>  [169] 55.21654 49.66645 48.99867 56.90364 53.35517 53.73060 70.24330 54.88152
#>  [177] 40.36087 55.67871 60.51852 53.68215 55.82273 55.10196 69.13523 53.80061
#>  [185] 54.74703 53.13507 51.75223 51.35078 56.52169 38.70997 36.54370 39.56877
#>  [193] 62.02698 39.29574 52.89552 36.35057 54.43609 39.95525 51.23795 37.87298
#>  [201] 34.15581 46.31157 37.61715 55.21746 48.92727 40.92882 39.65953 38.20394
#>  [209] 42.33635 61.08768 37.65515 69.32789 49.33902 54.06657 45.53719 56.60999
#>  [217] 35.92147 63.09550 44.71784 40.33641 46.14801 55.05750 39.39941 35.10669
#>  [225] 59.84521 45.39361 32.66029 55.47544       NA 36.96080       NA       NA
#>  [233] 33.18379 38.55924 49.97927 38.16616       NA 56.53589 55.92352 47.23062
#>  [241] 40.84002 48.59364 55.82765 59.18653 52.98205 40.27611 39.65953 40.84002
#>  [249] 41.03482 42.86134 47.98749 44.12082 37.62257 45.49594 34.66782 35.93741
#>  [257] 39.54711 46.22348 55.70498 60.47940 53.70742 57.83715 33.74214 33.56975
#>  [265] 35.29458 35.84605 38.57781 38.52905 50.12399 50.00802 55.82133 38.94538
#>  [273] 40.24052 42.62800 41.83564 38.15018 34.74295 48.32527 37.77789 39.19004
#>  [281] 82.32867 37.99351 39.59904 37.34123 44.83761 58.37142 59.36103 38.75980
#>  [289] 39.32614 37.05237 38.83804 34.09521 34.16448 42.04500 51.77899 33.26076
#>  [297] 35.98192 46.57490 43.85776 33.11436 40.56837 38.48589 59.24216 42.57988
#>  [305] 42.55873 47.95010 43.23401 42.98868 37.02144 47.16749 50.72618 34.87881
#>  [313] 39.77030 42.29761 38.15746 43.64706 38.82436 43.61793 55.27165 35.85311
#>  [321] 48.88464 42.47827 36.54833 42.90921 39.91312 37.89243 43.94521 48.96211
#>  [329] 42.76628 41.00525 55.40882 44.80626 32.99773 43.44436 32.57189 39.41286
#>  [337] 45.30443 41.07976 51.83501 39.11095 41.02712 40.93030 38.82232 41.73673
#>  [345] 42.72757 36.24685 39.54711 57.83073 53.95898 41.23026 48.33708 60.49837
#>  [353] 36.86973 45.86951 37.35576 36.29712 50.44380 57.56335 40.44405 39.56329
#>  [361] 39.29283 46.03853 42.43181 62.93753 43.32269 35.44631 42.83709 62.50598
#>  [369] 73.27667 65.03379 86.28305 76.67442 72.15026 67.47875 54.17741 85.54885
#>  [377] 67.82470 78.18267 29.32739 34.59092 38.99102 53.83761 33.51736 31.06428
#>  [385] 48.16529 47.50133 34.28930 37.26488 32.94664 32.90709 36.04890 40.23471
#>  [393] 32.18340 40.68701 59.52181 33.40888 39.69210 70.61768 67.34253 69.57920
#>  [401] 67.81644 31.33750 42.84589 41.74154 47.85105 46.53161 45.40789 57.72231
#>  [409] 42.53140 56.74651 57.88247 44.65738 64.28463 28.82372 46.70732 30.29003
#>  [417] 64.07557       NA 56.89796       NA       NA 28.06305 27.60299 41.43034
#>  [425] 31.65971       NA 60.88071 58.21685 51.75095 44.41961 55.58222 46.06155
#>  [433] 55.14921 47.93735 63.27472 66.07943 74.77971 67.08047 46.39951 43.05460
#>  [441] 44.20864 62.17452 37.08441 58.76306 44.24054 65.74280 63.19882 57.35663
#>  [449] 55.69581 56.95586 45.09989 30.36985 28.82892 34.51514 31.51437 36.68686
#>  [457] 30.01373 42.86579 36.40371 44.23144 34.92925 28.10603 31.20332 38.41833
#>  [465] 29.29761 44.27043 41.47922 34.14759 35.03310 64.43010 49.70402 51.65843
#>  [473] 62.98227 40.48169 62.12354 59.73887 51.87304 50.44776 36.50435 35.41828
#>  [481] 28.55099 29.51931 33.21991 44.07005 55.78835 33.21991 34.09521 32.72051
#>  [489] 28.36621 35.60190 46.01510 66.53464 40.98935 51.52592 47.10971 31.26330
#>  [497] 52.61101 58.96762 76.44728 32.24183 35.08167 39.66995 58.62836 30.93297
#>  [505] 79.86411 32.88095 84.33841 44.87641 30.57149 36.36232 77.04975 51.56259
#>  [513] 41.21057 40.65531 54.31294 34.43960 45.91763 58.16766 65.07463 56.00367
#>  [521] 31.81671 37.92246 70.64117 65.53867 32.17742 26.38150 41.42388 39.05040
#>  [529] 26.69143 30.47378 50.02026 32.36141 53.09680 60.00614 30.49033 29.24432
#>  [537] 55.60887 45.00358 39.12669 41.65179 40.95254 33.26456 36.47928 31.34161
#>  [545] 35.27405 52.44617 49.63029 41.33255 32.56989 55.95001 47.17276 72.01985
#>  [553] 41.70411 49.82891 58.89107 83.13432 37.19917 51.29240 43.27081 54.48495
#>  [561] 49.67295 61.87755 51.77511 51.71069 62.44871 54.32910 46.10964 37.20307
#>  [569] 42.60924 42.36939 55.66210 36.50654 28.12229 44.98266 40.73488 39.68483
#>  [577] 33.89321 35.07644 31.29328 37.23674 35.15160 24.09920 43.02582 44.24054
#>  [585] 34.50138 36.74814 44.45524 57.73408 55.81713 55.52887 32.00615 46.61955
#>  [593] 43.82827 52.25272 44.28340 32.30634 45.94706 46.29890 57.03403 60.43086
#>  [601] 37.80844 52.52879 24.03043 46.29890 34.98563 48.91317       NA 35.36104
#>  [609]       NA       NA 32.17995 33.14861 33.07439 31.81263       NA 45.98053
#>  [617] 50.29339 42.60924 39.81050 58.16563 44.21994 57.33068 55.60887 53.13678
#>  [625] 51.51249 56.19087 44.60264 43.04048 37.77701 41.41865 45.60184 40.11851
#>  [633] 44.60264 35.97448 48.39456 46.92982 63.30485 60.57937 62.14762 50.15227
#>  [641] 35.67071 37.29372 41.93147 35.43619 39.25327 35.07644 39.12648 34.02641
#>  [649] 37.59343 40.39110 30.50386 31.35322 36.38825 33.23902 34.84857 34.99025
#>  [657] 38.11410 54.00196 52.67739 40.63239 39.88277 45.58367 48.13595 43.23401
#>  [665] 44.34235 43.61044 37.32548 38.73346 40.95918 34.16779 33.26914 37.90859
#>  [673] 45.51905 36.03509 38.18770 34.00422 35.57795 35.30598 39.53849 41.18003
#>  [681] 52.98184 41.23013 45.19079 49.73932 34.50629 43.96774 39.44244 56.45246
#>  [689] 37.20932 35.95170 43.07239 48.82751 42.66905 56.03252 39.65953 60.28191
#>  [697] 48.65672 36.02866 38.61957 53.72876 39.08068 44.74838 37.27040 41.52975
#>  [705] 37.64127 61.88382 41.81122 41.95043 36.84037 37.84806 34.35581 55.13827
#>  [713] 50.26521 40.81274 26.38582 44.18887 42.72879 28.44078 41.74385 41.80130
#>  [721] 35.57935 39.58059 43.18932 37.35576 30.11424 48.68087 39.36468 42.65778
#>  [729] 46.20039 33.32297 41.41178 32.84083 39.38273 42.33933 57.88857 25.32749
#>  [737] 45.50372 34.93924 47.78966 54.57577 47.96313 42.52905 38.27836 49.44254
#>  [745] 53.43132 34.36509 38.14455 36.28099 35.66763 42.44288 43.73652 52.51799
#>  [753] 41.18312 40.05645 44.08868 49.42094 26.65033 34.37488 33.92340 40.76199
#>  [761] 25.06563 20.93434 32.57429 35.51838 26.69143 25.29857 22.59549 27.53818
#>  [769] 34.68651 34.14613 21.16587 30.53360 40.21068 32.68906 24.95207 38.15778
#>  [777] 51.08156 52.95299 56.55501 28.27318 36.07250 41.85407 42.03559 29.60585
#>  [785] 36.88376 49.67675 34.04170 45.91711 52.76302 32.60388 43.54381 17.07366
#>  [793] 36.53015 23.14273 30.26345       NA 27.83037       NA       NA 23.73401
#>  [801] 31.83148 23.99132 22.94947       NA 35.41898 40.42879 35.26919 28.45284
#>  [809] 44.95738 34.05963 50.17623 43.52904 33.01607 32.54036 56.34588 45.10274
#>  [817] 34.43580 33.62110 36.01212 38.28318 31.90968 29.54708 26.25774 57.44796
#>  [825] 50.34971 61.77776 45.56621 53.36291 32.09569 31.56273 28.33590 26.70060
#>  [833] 25.25272 29.28228 27.65715 36.14053 26.32153 38.50344 32.06256 24.70921
#>  [841] 28.93321 31.97628 26.37271 23.72431 34.28477 32.47871 37.23488 55.00341
#>  [849] 27.21999 30.14391 39.73118 35.72081 41.39331 38.46708 36.20887 28.19412
#>  [857] 29.55249 24.89528 27.56948 29.58760 29.35166 35.54777 26.73684 34.40490
#>  [865] 28.74283 30.12881 30.83062 35.05998 41.11045 52.08616 29.27257 34.60374
#>  [873] 45.67332 28.91148 38.79407 39.13773 60.38081 21.82278 22.39934 35.18054
#>  [881] 49.99518 33.26076 53.55194 32.62855 67.73660 34.57625 26.30392 31.03806
#>  [889] 49.10303 29.22336 44.27781 29.52284 34.28710 33.05811 49.13518 32.04002
#>  [897] 31.36326 23.82834 29.62890 24.01396 49.25819 42.56639 28.94908 24.17658
#>  [905] 26.64625 34.75949 25.22428 27.49122 32.19292 25.69830 35.85923 33.34448
#>  [913] 27.86411 25.90717 34.16795 36.99112 32.19292 34.96976 24.51543 25.16740
#>  [921] 25.87859 25.82608 27.69112 48.67855 21.76315 43.87747 27.71390 38.10433
#>  [929] 44.23969 38.31795 24.95173 26.48761 43.48518 55.13718 34.87733 42.20901
#>  [937] 49.08204 67.98319 48.31063 59.80460 65.09298 49.14084 55.92418 63.55267
#>  [945] 56.04848 36.35652 43.07118 44.38585 50.03969 38.56318 29.82310 39.01687
#>  [953] 57.33511 36.93115 31.67166 33.91167 28.81274 36.28707 42.69806 25.86237
#>  [961] 38.64561 50.00802 34.39805 37.21449 48.10487 51.02649 53.07589 71.60357
#>  [969] 33.69337 42.53213 43.82152 48.24525 41.12924 67.90040 43.27521 50.01188
#>  [977] 56.07075 59.95676 38.60987 48.53872 33.44962 40.18323 34.70281 45.34034
#>  [985]       NA 39.31571       NA       NA 34.83127 33.90731 34.78956 33.73387
#>  [993]       NA 36.81964 44.48176 43.10038 41.73633 40.74393 38.09740 52.27832
#>  [ reached getOption("max.print") -- omitted 4652 entries ]
# }