Title: | Interface to the Greek National Data Bank for Hydrometeorological Information |
---|---|
Description: | R interface to the Greek National Data Bank for Hydrological and Meteorological Information. It covers Hydroscope's data sources and provides functions to transliterate, translate and download them into tidy dataframes. |
Authors: | Konstantinos Vantas [aut, cre] , Sharla Gelfand [ctb, rev] (Sharla Gelfand reviewed the package for rOpenSci, see https://github.com/ropensci/onboarding/issues/185), Tim Trice [rev] (Tim Trice reviewed the package for rOpenSci, see https://github.com/ropensci/onboarding/issues/185) |
Maintainer: | Konstantinos Vantas <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.7.0 |
Built: | 2024-10-17 05:46:41 UTC |
Source: | https://github.com/ropensci/hydroscoper |
find_stations
returns a tibble with the nearest stations'
distances using a given point's longitude and latitude values. This function
uses the Haversine formula for distance calculation in km.
find_stations(longitude = 24, latitude = 38)
find_stations(longitude = 24, latitude = 38)
longitude |
a numeric value in degrees |
latitude |
a numeric value in degrees |
If the given longitude is in [24, 38] and the latitude is in [34, 42] (i.e. are valid values for Greece) returns an ordered tibble with the station_id, name, subdomain and distance values in km. The station's data that are used come from the 'stations' dataset. Otherwise returns an error message.
# find the five nearest stations to a point near Thessaloniki, # (lon, lat) = (22.97, 40.60) head(find_stations(22.97, 40.60), 5)
# find the five nearest stations to a point near Thessaloniki, # (lon, lat) = (22.97, 40.60) head(find_stations(22.97, 40.60), 5)
get_data
returns a tibble from a Hydroscope's
time-series text file.
get_data(subdomain = c("kyy", "ypaat", "emy", "deh"), time_id)
get_data(subdomain = c("kyy", "ypaat", "emy", "deh"), time_id)
subdomain |
One of the subdomains of hydroscope.gr |
time_id |
A time series ID |
If subdomain
is one of:
kyy
, Ministry of Environment and Energy
ypaat
, Ministry of Rural Development and Food
deh
, Greek Public Power Corporation
emy
, National Meteorological Service
and time_id
exists in that subdomain
, returns a tibble with
the time series values. Otherwise returns an error message.
The dataframe columns are:
The time series Dates (POSIXct)
The time series values (numeric)
Comments about the values (character)
Data are not available freely in the sub-domains: "deh"
(Greek Public Power Corporation) and
"emy"
(National Meteorological Service).
Konstantinos Vantas, [email protected]
Stations' data are retrieved from the Hydroscope's databases:
Ministry of Environment, Energy and Climate Change.
Ministry of Rural Development and Food.
## Not run: # get time series 912 from the Greek Ministry of Environment and Energy time_series <- get_data("kyy", 912) ## End(Not run)
## Not run: # get time series 912 from the Greek Ministry of Environment and Energy time_series <- get_data("kyy", 912) ## End(Not run)
A family of functions that return a tibble from a specific
database from Hydroscope using the Enhydris API. get_database
returns
a named list of tibbles using all the family's functions.
get_stations(subdomain = c("kyy", "ypaat", "emy", "deh"), translit = TRUE) get_timeseries(subdomain = c("kyy", "ypaat", "emy", "deh"), translit = TRUE) get_instruments(subdomain = c("kyy", "ypaat", "emy", "deh"), translit = TRUE) get_water_basins(subdomain = c("kyy", "ypaat", "emy", "deh"), translit = TRUE) get_water_divisions( subdomain = c("kyy", "ypaat", "emy", "deh"), translit = TRUE ) get_political_divisions( subdomain = c("kyy", "ypaat", "emy", "deh"), translit = TRUE ) get_variables(subdomain = c("kyy", "ypaat", "emy", "deh"), translit = TRUE) get_units_of_measurement( subdomain = c("kyy", "ypaat", "emy", "deh"), translit = TRUE ) get_time_steps(subdomain = c("kyy", "ypaat", "emy", "deh"), translit = TRUE) get_owners(subdomain = c("kyy", "ypaat", "emy", "deh"), translit = TRUE) get_instruments_type( subdomain = c("kyy", "ypaat", "emy", "deh"), translit = TRUE ) get_station_type(subdomain = c("kyy", "ypaat", "emy", "deh"), translit = TRUE) get_database(subdomain = c("kyy", "ypaat", "emy", "deh"), translit = TRUE)
get_stations(subdomain = c("kyy", "ypaat", "emy", "deh"), translit = TRUE) get_timeseries(subdomain = c("kyy", "ypaat", "emy", "deh"), translit = TRUE) get_instruments(subdomain = c("kyy", "ypaat", "emy", "deh"), translit = TRUE) get_water_basins(subdomain = c("kyy", "ypaat", "emy", "deh"), translit = TRUE) get_water_divisions( subdomain = c("kyy", "ypaat", "emy", "deh"), translit = TRUE ) get_political_divisions( subdomain = c("kyy", "ypaat", "emy", "deh"), translit = TRUE ) get_variables(subdomain = c("kyy", "ypaat", "emy", "deh"), translit = TRUE) get_units_of_measurement( subdomain = c("kyy", "ypaat", "emy", "deh"), translit = TRUE ) get_time_steps(subdomain = c("kyy", "ypaat", "emy", "deh"), translit = TRUE) get_owners(subdomain = c("kyy", "ypaat", "emy", "deh"), translit = TRUE) get_instruments_type( subdomain = c("kyy", "ypaat", "emy", "deh"), translit = TRUE ) get_station_type(subdomain = c("kyy", "ypaat", "emy", "deh"), translit = TRUE) get_database(subdomain = c("kyy", "ypaat", "emy", "deh"), translit = TRUE)
subdomain |
One of the subdomains of Hydroscope in the vector
|
translit |
Automatically transliterate Greek to Latin. |
If subdomain
is one of:
kyy
, Ministry of Environment and Energy.
ypaat
, Ministry of Rural Development and Food.
deh
, Greek Public Power Corporation.
emy
, National Meteorological Service.
returns a tibble or a named list with tibbles from the corresponding database. Otherwise returns an error message.
Objects' IDs are not unique among the different Hydroscope databases. For example, time series' IDs from http://kyy.hydroscope.gr have same values with time series' from http://ypaat.hydroscope.gr.
The coordinates of the stations are based on the European Terrestrial Reference System 1989 (ETRS89).
Konstantinos Vantas, [email protected]
The data are retrieved from the Hydroscope's site databases:
Ministry of Environment, Energy and Climate Change.
Ministry of Rural Development and Food.
National Meteorological Service.
Greek Public Power Corporation.
## Not run: # data will be downloaded from Ministry of Environment and Energy (kyy): subdomain <- "kyy" # stations kyy_stations <- get_stations(subdomain) # time series kyy_ts <- get_timeseries(subdomain) # instruments kyy_inst <- get_instruments(subdomain) # water basins kyy_wbas <- get_water_basins(subdomain) # water divisions kyy_wdiv <- get_water_divisions(subdomain) # political divisions kyy_pol <- get_political_divisions(subdomain) # variables kyy_vars <- get_variables(subdomain) # units of measurement kyy_units <- get_units_of_measurement(subdomain) # time steps kyy_time_steps <- get_time_steps(subdomain) # owners kyy_owners <- get_owners(subdomain) # instruments type kyy_instr_type <- get_instruments_type(subdomain) # stations' type kyy_st_type <- get_station_type(subdomain) # use all the get_ functions above to create a named list with tibbles kyy_db <- get_database(subdomain) ## End(Not run)
## Not run: # data will be downloaded from Ministry of Environment and Energy (kyy): subdomain <- "kyy" # stations kyy_stations <- get_stations(subdomain) # time series kyy_ts <- get_timeseries(subdomain) # instruments kyy_inst <- get_instruments(subdomain) # water basins kyy_wbas <- get_water_basins(subdomain) # water divisions kyy_wdiv <- get_water_divisions(subdomain) # political divisions kyy_pol <- get_political_divisions(subdomain) # variables kyy_vars <- get_variables(subdomain) # units of measurement kyy_units <- get_units_of_measurement(subdomain) # time steps kyy_time_steps <- get_time_steps(subdomain) # owners kyy_owners <- get_owners(subdomain) # instruments type kyy_instr_type <- get_instruments_type(subdomain) # stations' type kyy_st_type <- get_station_type(subdomain) # use all the get_ functions above to create a named list with tibbles kyy_db <- get_database(subdomain) ## End(Not run)
The borders of Greece are taken from Geoadata.gov.gr. The variables are created using the function tidy from the broom package. This data frame was created for use with the geom_polygon from ggplot2 package.
greece_borders
greece_borders
A tibble with 18,474 rows and 8 variables:
Longitude in decimal degrees, ETRS89
Latitude in decimal degrees, ETRS89
order, integer
hole, boolean
piece, integer
group, numeric
Konstantinos Vantas
hydro_coords
returns a tibble with the stations'
longitude and latitude using as input the variable point
from get_stations
function.
hydro_coords(x)
hydro_coords(x)
x |
a string vector with the points retrieved from Hydroscope |
a tibble with the longitude and latitude values.
Konstantinos Vantas, [email protected]
## Not run: # get stations from the Greek Ministry of Environment and Energy kyy_stations <- get_stations("kyy") # create a tibble with stations' coords coords <- hydro_coords(kyy_stations$point) ## End(Not run)
## Not run: # get stations from the Greek Ministry of Environment and Energy kyy_stations <- get_stations("kyy") # create a tibble with stations' coords coords <- hydro_coords(kyy_stations$point) ## End(Not run)
hydro_translate
translates various Hydroscope's names and
terms to English.
hydro_translate(x, value = c("owner", "variable", "timestep", "division"))
hydro_translate(x, value = c("owner", "variable", "timestep", "division"))
x |
a string vector |
value |
One of the predefined values in
|
If value
is one of:
owner
, organizations' names.
variable
, hydrometeorological term.
timestep
, timestep term.
division
, Water Division.
returns a character vector with translations of various hydrometeorological terms or organizations' names from Greek (with latin characters) to English.
The organizations' names in owner
are:
Code | Name |
min_envir_energy | Ministry of Environment and Energy |
min_agricult | Ministry of Rural Development and Food |
natio_meteo_service | National Meteorological Service |
natio_observ_athens | National Observatory of Athens |
public_power_corp | Public Power Corporation |
natio_argic_resear | National Agricultural Research Foundation |
greek_perfectures | Greek Prefectures |
crete_eng_faculty | Technical University of Crete |
crete_natural_museum | Natural History Museum of Crete |
The Greek Water Divisions codes in division
are:
Code | Name |
GR01 | Dytike Peloponnesos |
GR02 | Boreia Peloponnesos |
GR03 | Anatolike Peloponnesos |
GR04 | Dytike Sterea Ellada |
GR05 | Epeiros |
GR06 | Attike |
GR07 | Anatolike Sterea Ellada |
GR08 | Thessalia |
GR09 | Dytike Makedonia |
GR10 | Kentrike Makedonia |
GR11 | Anatolike Makedonia |
GR12 | Thrake |
GR13 | Krete |
GR14 | Nesoi Aigaiou |
The dictionary used for the Greek to English translation is:
Transliterated term | English term |
agnosto | unknown |
anemos | wind |
dieuthynse | direction |
parelthon | past |
tachyteta | speed |
mese | average |
brochoptose | precipitation |
diarkeia | duration |
exatmise | evaporation |
exatmisodiapnoe | evapotranspiration |
thermokrasia | temperature |
edaphous | ground |
bathos | depth |
elachiste | min |
megiste | max |
piese | pressure |
semeiake | point |
chioni | snow |
ypsometro | elevation |
stathme | level |
plemmyra | flood |
paroche | flow |
broche | precipitation |
katastase | condition |
ektimemene | estimation |
athroistiko | cumulative |
stereo | sediment |
ygrasia | humidity |
ygro | wet |
apolyte | absolute |
schetike | relative |
asbestio | calcium |
wetu | precipitation |
chionobrochometro | snow_rain_gauge |
xero | dry |
ydrometrese | flow_gauge |
thalasses | sea |
semeio_drosou | dew_point |
oratoteta | visibility |
steria | land |
thalassa | sea |
barometro | barometer |
tase_ydratmon | vapour_pressure |
psychrometro | psychrometer |
isodynamo_ypsos | water_equivalent |
agogimoteta | conductance |
aktinobolia | radiation |
anthraka | carbon |
dioxeidio | dioxide |
ypoloipo | residual |
argilio | aluminum |
argilos | clay |
arseniko | arsenic |
pyritiou | silicon |
aera | air |
nephokalypse | cloud_cover |
nephose | clouds |
axiosemeiota | remarkably |
nephe | clouds |
kairos | weather |
diafora | difference |
atmosfairiki | atmospheric |
stathera | constant |
parousa | present |
parelthousa | past |
kalymeno | cover |
el. | min |
meg. | max |
skleroteta | hardness |
eliophaneia | sunshine |
eisroe_se_tamieuteres | inflow_reservoir |
## Not run: # get data from the Ministry of Environment and Energy kyy_owners <- get_owners("kyy") kyy_vars <- get_variables("kyy") owners_names <- hydro_translate(kyy_owners$name, "owner") vars <- hydro_translate(kyy_vars$descr, "variable") ## End(Not run)
## Not run: # get data from the Ministry of Environment and Energy kyy_owners <- get_owners("kyy") kyy_vars <- get_variables("kyy") owners_names <- hydro_translate(kyy_owners$name, "owner") vars <- hydro_translate(kyy_vars$descr, "variable") ## End(Not run)
hydroscoper
provides an R interface to the Greek
National Data Bank for Hydrological and Meteorological Information
http://www.hydroscope.gr
.
hydroscoper
covers Hydroscope's data sources using the
Enhydris API
and provides functions to:
Transform the available tables and data sets into tibbles.
Transliterate the Greek Unicode names to Latin.
Translate various Greek terms to English.
The Enhydris database is implemented in PostgreSQL. Details can be found here
The data are retrieved from the Hydroscope's databases:
Ministry of Environment, Energy and Climate Change.
Ministry of Rural Development and Food.
National Meteorological Service.
Greek Public Power Corporation.
Maintainer: Konstantinos Vantas [email protected] (ORCID)
Other contributors:
Sharla Gelfand (Sharla Gelfand reviewed the package for rOpenSci, see https://github.com/ropensci/onboarding/issues/185) [contributor, reviewer]
Tim Trice (Tim Trice reviewed the package for rOpenSci, see https://github.com/ropensci/onboarding/issues/185) [reviewer]
Useful links:
Report bugs at https://github.com/ropensci/hydroscoper/issues
Stations' data from the Greek National Data Bank for Hydrological and Meteorological Information. This dataset is a comprehensive look-up table with geographical and ownership information of the available stations in all Hydroscope's databases.
stations
stations
A tibble with 2,322 rows and 9 variables:
The station's ID from the domain's database
The station's name
The station's Water Basin
The station's Water Division
The station's owner
The station's longitude in decimal degrees, ETRS89
The station's latitude in decimal degrees, ETRS89
The station's altitude, meters above sea level
The corresponding Hydroscope's database
Time series' data from the Greek National Data Bank for Hydrological and Meteorological Information. This dataset is a comprehensive look-up table of all of the available measurements for a given station in a given Hydroscope's database, with units of measurement and times of those measurements.
timeseries
timeseries
A tibble with 10,804 rows and 9 variables:
The time series ID
The corresponding station's ID
The time series variable type
The timestep of time series
The units of the time series
The starting date of time series values
The ending date of time series values
The corresponding Hydroscope's database