Meteoclimatic service

library(meteospain)
library(ggplot2)
library(ggforce)
library(units)
library(sf)

Meteoclimatic service

Meteoclimatic is a non-professional (amateur) network of automatic meteorological stations. This network cover all Spain, but does not offer quality testing of the data.

Meteoclimatic options

Temporal resolution

Meteoclimatic API only offers aggregated data for the current day, so, in this case the resolution parameter is limited to “current_day”.

Stations

Meteoclimatic API does not accept multiple stations in the same query. But it has station codes that can access the data from several stations in the same geographic area (i.e. “ES” for all stations, “ESCAT” for all stations in Catalunya, “ESCAT08” for all stations in Barcelona province). So, the stations is limited at length one.

Example

api_options <- meteoclimatic_options(stations = 'ESCAT08')
api_options
#> $resolution
#> [1] "current_day"
#> 
#> $stations
#> [1] "ESCAT08"

Meteoclimatic stations info

Accessing station metadata for Meteoclimatic is simple:

get_stations_info_from('meteoclimatic', options = api_options)
#> Simple feature collection with 189 features and 3 fields
#> Geometry type: POINT
#> Dimension:     XY
#> Bounding box:  xmin: 1.59 ymin: 41.22 xmax: 2.72 ymax: 42.3
#> Geodetic CRS:  WGS 84
#> # A tibble: 189 × 4
#>    service       station_id          station_name          geometry
#>  * <chr>         <chr>               <chr>              <POINT [°]>
#>  1 meteoclimatic ESCAT0800000008591B Aiguafreda Aj. (… (2.25 41.77)
#>  2 meteoclimatic ESCAT0800000008328F Alella-Mirador (… (2.29 41.49)
#>  3 meteoclimatic ESCAT0800000008358A Arenys de Munt (… (2.54 41.61)
#>  4 meteoclimatic ESCAT0800000008310B Argentona (Barce… (2.39 41.56)
#>  5 meteoclimatic ESCAT0800000008915A Badalona - Bufal… (2.24 41.46)
#>  6 meteoclimatic ESCAT0800000008911C Badalona - Dalt … (2.26 41.46)
#>  7 meteoclimatic ESCAT0800000008080A Badalona - Llefi… (2.23 41.44)
#>  8 meteoclimatic ESCAT0800000008912B Badalona - Progr… (2.24 41.45)
#>  9 meteoclimatic ESCAT0800000008695C Bagà (centre) (B… (1.86 42.25)
#> 10 meteoclimatic ESCAT0800000008695A Bagà (nord) (Bar… (1.86 42.26)
#> # ℹ 179 more rows

Meteoclimatic data

current_day_barcelona <- get_meteo_from('meteoclimatic', options = api_options)
#> ℹ Meteoclimatic is a non-professional network of automatic meteorological
#>   stations.
#> No quality check is performed in this data, and errors in measures or
#> coordinates of stations can be present.
#> https://www.meteoclimatic.net/index
current_day_barcelona
#> Simple feature collection with 189 features and 9 fields
#> Geometry type: POINT
#> Dimension:     XY
#> Bounding box:  xmin: 1.59 ymin: 41.22 xmax: 2.72 ymax: 42.3
#> Geodetic CRS:  WGS 84
#> # A tibble: 189 × 10
#>    timestamp           service       station_id     station_name min_temperature
#>  * <dttm>              <chr>         <chr>          <chr>                   [°C]
#>  1 2024-10-17 06:10:00 meteoclimatic ESCAT08000000… Montmeló-T.…            16.7
#>  2 2024-10-17 06:15:00 meteoclimatic ESCAT08000000… Terrassa - …            17.9
#>  3 2024-10-17 06:15:00 meteoclimatic ESCAT08000000… Vacarisses …            14  
#>  4 2024-10-17 06:15:00 meteoclimatic ESCAT08000000… Puigllançad…             7.6
#>  5 2024-10-17 06:15:00 meteoclimatic ESCAT08000000… Cadí Est- P…             5.2
#>  6 2024-10-17 06:15:00 meteoclimatic ESCAT08000000… Bagà (refug…             9.2
#>  7 2024-10-17 06:15:00 meteoclimatic ESCAT08000000… La Pobla de…            13.3
#>  8 2024-10-17 06:16:00 meteoclimatic ESCAT08000000… El Prat-Zon…            19.3
#>  9 2024-10-17 06:19:00 meteoclimatic ESCAT08000000… Aiguafreda …            13.9
#> 10 2024-10-17 06:21:00 meteoclimatic ESCAT08000000… Taradell (D…            13.8
#> # ℹ 179 more rows
#> # ℹ 5 more variables: max_temperature [°C], min_relative_humidity [%],
#> #   max_relative_humidity [%], precipitation [L/m^2], geometry <POINT [°]>

Visually:

current_day_barcelona |>
  units::drop_units() |>
  ggplot() +
  geom_sf(aes(colour = max_temperature)) +
  scale_colour_viridis_c()


current_day_barcelona |>
  ggplot() +
  geom_histogram(aes(x = max_relative_humidity))
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#> Warning: Removed 3 rows containing non-finite outside the scale range
#> (`stat_bin()`).