Introduction to the climate package

Bartosz Czernecki, Arkadiusz Głogowski, Jakub Nowosad

2020-04-20

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 available in Ogimet repository for a selected country:

Example 3

Downlading hourly meteorological data Svalbard in 2018 from Ogimet

Examplary data frame of meteorological data.
date lon lat alt t2m dpt2m ws wd slp visibility
1 2018-01-01 00:00:00 15.502 78.245 28 -14.9 -18.9 6.5 97 1007.7 75000
3 2018-01-01 01:00:00 15.467 78.250 29 -14.5 -18.9 5.0 100 1007.6 NA
5 2018-01-01 02:00:00 15.467 78.250 29 -11.6 -18.1 4.0 100 1007.2 NA
7 2018-01-01 03:00:00 15.467 78.250 29 -12.0 -18.7 4.0 100 1006.9 70000
8 2018-01-01 04:00:00 15.467 78.250 29 -11.5 -18.2 3.0 100 1006.4 NA
10 2018-01-01 05:00:00 15.467 78.250 29 -11.3 -17.8 3.0 100 1006.3 NA
12 2018-01-01 06:00:00 15.467 78.250 29 -11.3 -18.2 4.0 110 1006.0 70001
14 2018-01-01 07:00:00 15.467 78.250 29 -10.4 -18.6 4.0 120 1006.1 NA
16 2018-01-01 08:00:00 15.467 78.250 29 -11.1 -17.0 9.0 90 1006.2 NA
19 2018-01-01 09:00:00 15.467 78.250 29 -11.7 -17.8 5.0 100 1006.0 70001

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
1003 6 6.0 2.8 80 4.69 260 25 278.9 292.0 279.7
1000 29 5.8 2.2 78 4.51 260 25 278.9 291.5 279.7
986 143 4.8 1.6 80 4.39 260 43 279.1 291.4 279.8
925 661 0.4 -0.9 91 3.89 275 52 279.7 290.7 280.4
902 863 -1.3 -2.0 95 3.68 277 54 280.0 290.4 280.6
868 1167 -4.0 -4.7 95 3.12 280 56 280.2 289.2 280.8
850 1333 -5.5 -6.2 95 2.84 280 56 280.4 288.6 280.9
826 1557 -7.3 -8.0 95 2.54 280 56 280.8 288.2 281.2
808 1728 -7.9 -13.9 62 1.62 280 55 281.9 286.8 282.2
788 1922 -9.5 -13.3 74 1.75 280 55 282.2 287.4 282.5

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.7 29.2 40.3 29.5 54.0 57.7 85.1 55.7 41.4 35.2 34.3 40.4
tmax 9.2 11.1 17.3 24.1 27.8 31.5 32.6 32.3 26.8 21.2 14.0 10.0
tmin -13.8 -11.9 -7.8 -3.4 1.0 5.8 8.6 7.1 2.6 -3.0 -5.7 -10.3
tavg -0.5 0.4 3.8 9.5 14.2 17.4 19.5 19.1 14.3 9.0 4.3 0.9

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
149180010 KRZYŻANOWICE 18.28780 49.99301 200.5 147.4 87.9 109.2 170.6
149180020 CHAŁUPKI 18.32752 49.92127 174.7 96.7 57.6 91.8 146.9
149180040 GOŁKOWICE 18.49640 49.92579 4.5 2.0 1.7 1.7 2.5
149180050 ZEBRZYDOWICE 18.61326 49.88025 13.5 7.9 3.8 5.0 10.4
149180060 CIESZYN 18.62972 49.74616 57.2 57.7 29.8 26.8 65.4
149180070 CIESZYN 18.63137 49.74629 NaN NaN NaN NaN NaN

Acknowledgment

Ogimet.com, University of Wyoming, and Institute of Meteorology and Water Management - National Research Institute (IMGW-PIB), National Oceanic & Atmospheric Administration (NOAA) - Earth System Research Laboratory, Global Monitoring Division and Integrated Surface Hourly (NOAA ISH) 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")