Package 'hydroscoper'

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-08-18 02:31:48 UTC
Source: https://github.com/ropensci/hydroscoper

Help Index


Find nearest stations using a point's coordinates

Description

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.

Usage

find_stations(longitude = 24, latitude = 38)

Arguments

longitude

a numeric value in degrees

latitude

a numeric value in degrees

Value

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.

Examples

# 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 time series values in a tibble

Description

get_data returns a tibble from a Hydroscope's time-series text file.

Usage

get_data(subdomain = c("kyy", "ypaat", "emy", "deh"), time_id)

Arguments

subdomain

One of the subdomains of hydroscope.gr

time_id

A time series ID

Value

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:

date

The time series Dates (POSIXct)

value

The time series values (numeric)

comment

Comments about the values (character)

Note

Data are not available freely in the sub-domains: "deh" (Greek Public Power Corporation) and "emy" (National Meteorological Service).

Author(s)

Konstantinos Vantas, [email protected]

References

Stations' data are retrieved from the Hydroscope's databases:

  • Ministry of Environment, Energy and Climate Change.

  • Ministry of Rural Development and Food.

Examples

## Not run: 
# get time series 912 from the Greek Ministry of Environment and Energy
time_series <- get_data("kyy", 912)

## End(Not run)

Get tibbles from Hydroscope

Description

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.

Usage

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)

Arguments

subdomain

One of the subdomains of Hydroscope in the vector c("kyy", "ypaat", "emy", "deh").

translit

Automatically transliterate Greek to Latin.

Value

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.

Note

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).

Author(s)

Konstantinos Vantas, [email protected]

References

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.

Examples

## 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)

Greek borders

Description

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.

Usage

greece_borders

Format

A tibble with 18,474 rows and 8 variables:

long

Longitude in decimal degrees, ETRS89

lat

Latitude in decimal degrees, ETRS89

order

order, integer

hole

hole, boolean

piece

piece, integer

group

group, numeric

Source

Konstantinos Vantas


Convert coordinates from Hydroscope's points to a tibble

Description

hydro_coords returns a tibble with the stations' longitude and latitude using as input the variable point from get_stations function.

Usage

hydro_coords(x)

Arguments

x

a string vector with the points retrieved from Hydroscope

Value

a tibble with the longitude and latitude values.

Author(s)

Konstantinos Vantas, [email protected]

Examples

## 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)

Translate Greek names and terms to English

Description

hydro_translate translates various Hydroscope's names and terms to English.

Usage

hydro_translate(x, value = c("owner", "variable", "timestep", "division"))

Arguments

x

a string vector

value

One of the predefined values in c("owner", "variable", "timestep", "division")

Value

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

Note

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

Examples

## 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: Interface to Hydroscope

Description

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:

  1. Transform the available tables and data sets into tibbles.

  2. Transliterate the Greek Unicode names to Latin.

  3. Translate various Greek terms to English.

Enhydris API

The Enhydris database is implemented in PostgreSQL. Details can be found here

Data Sources

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.

Author(s)

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]

See Also

Useful links:


stations

Description

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.

Usage

stations

Format

A tibble with 2,322 rows and 9 variables:

station_id

The station's ID from the domain's database

name

The station's name

water_basin

The station's Water Basin

water_division

The station's Water Division

owner

The station's owner

longitude

The station's longitude in decimal degrees, ETRS89

latitude

The station's latitude in decimal degrees, ETRS89

altitude

The station's altitude, meters above sea level

subdomain

The corresponding Hydroscope's database


timeseries

Description

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.

Usage

timeseries

Format

A tibble with 10,804 rows and 9 variables:

time_id

The time series ID

station_id

The corresponding station's ID

variable

The time series variable type

timestep

The timestep of time series

units

The units of the time series

start_date

The starting date of time series values

end_date

The ending date of time series values

subdomain

The corresponding Hydroscope's database