Introduction to the climate package

Bartosz Czernecki, Arkadiusz Głogowski, Jakub Nowosad

2020-03-29

The goal of the climate R package is to automatize downloading of meteorological and hydrological data from publicly available repositories:

Functions

The climate package consists of ten main functions - three for meteorological data, one for hydrological data and six auxiliary functions and datasets:

Meteorological data

Hydrological data

Auxiliary functions and datasets

Examples

Examples shows aplication of climate package with additional use of tools that help with processing the data to increase legible of downloaded data.

Example 1

Finding a 50 nearest meteorological stations in a given country:

Example 2

Summary of stations availible in Ogimet repositoy selected by county:

Example 3

Downlading hourly meteorological data Svalbard in 2018

Examplary data frame of meteorological data.
station_ID Date TC TdC TmaxC TminC ddd ffkmh Gustkmh P0hPa PseahPa PTnd
2 1008 2018-12-31 23:00:00 -14.3 -19.2 NA NA NNW 25.2 43.2 1000.5 1004.2 0.3
3 1008 2018-12-31 22:00:00 -13.7 -18.2 NA NA NW 21.6 32.4 1000.0 1003.8 -0.4
4 1008 2018-12-31 21:00:00 -15.9 -18.5 NA NA ESE 10.8 21.6 999.9 1003.7 -0.6
5 1008 2018-12-31 20:00:00 -16.8 -20.1 NA NA E 18.0 25.2 1000.1 1003.9 -0.9
6 1008 2018-12-31 19:00:00 -17.2 -21.7 NA NA ESE 21.6 28.8 1000.5 1004.3 -1.3
7 1008 2018-12-31 18:00:00 -18.3 -20.8 -15.5 -19.5 ESE 21.6 32.4 1000.7 1004.5 -1.9
8 1008 2018-12-31 17:00:00 -18.1 -23.1 NA NA ESE 25.2 32.4 1001.2 1005.0 -1.9
9 1008 2018-12-31 16:00:00 -18.1 -22.6 NA NA E 21.6 25.2 1001.9 1005.7 -1.6
10 1008 2018-12-31 15:00:00 -19.2 -24.1 NA NA ESE 21.6 25.2 1002.6 1006.5 -1.2
11 1008 2018-12-31 14:00:00 -18.9 -24.7 NA NA ESE 18.0 25.2 1003.2 1007.0 -0.7

Example 4

Downloading sounding data for Łeba (Poland) station

Examplary data frame of sounding preprocesssing.
press HGHT temp dewpt RELH MIXR DRCT SKNT THTA THTE THTV
1042 6 0.4 -6.6 59 2.25 70 2 270.4 276.6 270.7
1036 51 1.8 -8.2 47 2.00 71 3 272.2 277.9 272.5
1000 328 -0.7 -10.7 47 1.70 80 10 272.4 277.3 272.7
925 944 -6.7 -11.1 71 1.78 65 12 272.4 277.5 272.8
921 977 -7.0 -11.2 72 1.77 65 12 272.5 277.5 272.8
874 1381 -10.9 -12.3 89 1.71 80 12 272.6 277.5 272.9
850 1596 -12.9 -12.9 100 1.68 55 12 272.6 277.4 272.9
849 1605 -13.0 -13.0 100 1.67 55 12 272.6 277.4 272.9
832 1759 -14.2 -14.3 99 1.52 75 14 272.9 277.3 273.2
820 1869 -15.1 -15.3 98 1.43 66 17 273.1 277.2 273.3

Example 5

Preparing a annual summary of air temperature and precipitation, processing with dplyr

Examplary data frame of meteorological preprocesssing.
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
precip 37.0 30.9 38.2 30.5 54.5 60.2 93.2 60.7 42.3 38.0 35.6 38.6
tmax 8.6 11.1 17.3 23.8 28.2 31.5 32.3 31.8 26.7 21.4 14.4 9.7
tmin -15.0 -12.2 -7.8 -3.3 0.9 5.6 8.9 7.4 2.7 -2.5 -5.2 -10.6
tavg -1.0 0.3 3.7 9.4 14.3 17.3 19.4 19.0 14.2 9.2 4.6 0.8

Example 6

Calculate the mean maximum value of the flow on the stations in each year with dplyr’s summarise(), and spread data by year using tidyr’s spread() to get the annual means of maximum flow in the consecutive columns.

Examplary data frame of hydrological preprocesssing.
id station X Y 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010
149180010 KRZYŻANOWICE 18.28780 49.99301 200.5 147.4 87.9 109.2 170.6 226.9 152.9 131.0 160.9 461.1
149180020 CHAŁUPKI 18.32752 49.92127 174.7 96.7 57.6 91.8 146.9 170.6 110.2 101.6 124.7 314.6
149180040 GOŁKOWICE 18.49640 49.92579 4.5 2.0 1.7 1.7 2.5 3.3 2.1 1.7 2.2 8.6
149180050 ZEBRZYDOWICE 18.61326 49.88025 13.5 7.9 3.8 5.0 10.4 6.5 5.8 2.8 4.5 23.6
149180060 CIESZYN 18.62972 49.74616 57.2 57.7 29.8 26.8 65.4 60.7 54.7 33.0 34.7 135.0
149180070 CIESZYN 18.63137 49.74629 NaN NaN NaN NaN NaN NaN 0.6 0.5 0.6 0.6

Acknowledgment

Ogimet.com, University of Wyoming, and Institute of Meteorology and Water Management - National Research Institute (IMGW-PIB) are the sources of the data.

Contribution

Contributions to this package are welcome. The preferred method of contribution is through a GitHub pull request. Feel also free to contact us by creating an issue.

Citation

To cite the climate package in publications, please use this paper:

Czernecki, B.; Głogowski, A.; Nowosad, J. Climate: An R Package to Access Free In-Situ Meteorological and Hydrological Datasets for Environmental Assessment. Sustainability 2020, 12, 394. https://doi.org/10.3390/su12010394"

LaTex version can be obtained with:

library(climate)
citation("climate")