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 244 features and 3 fields
#> Geometry type: POINT
#> Dimension:     XY
#> Bounding box:  xmin: 1.58 ymin: 41.22 xmax: 2.74 ymax: 42.29
#> Geodetic CRS:  WGS 84
#> # A tibble: 244 × 4
#>    service       station_id          station_name          geometry
#>  * <chr>         <chr>               <chr>              <POINT [°]>
#>  1 meteoclimatic ESCAT0800000008591A Aiguafreda (Barc… (2.25 41.77)
#>  2 meteoclimatic ESCAT0800000008591B Aiguafreda Aj. (… (2.25 41.77)
#>  3 meteoclimatic ESCAT0800000008328F Alella-Mirador (… (2.29 41.49)
#>  4 meteoclimatic ESCAT0800000008350A Arenys de Mar (B… (2.56 41.59)
#>  5 meteoclimatic ESCAT0800000008358A Arenys de Munt (… (2.54 41.61)
#>  6 meteoclimatic ESCAT0800000008310B Argentona (Barce… (2.39 41.56)
#>  7 meteoclimatic ESCAT0800000008610A Avià - Sud (Barc… (1.83 42.07)
#>  8 meteoclimatic ESCAT0800000008915A Badalona - Bufal… (2.24 41.46)
#>  9 meteoclimatic ESCAT0800000008912A Badalona - Centr… (2.25 41.45)
#> 10 meteoclimatic ESCAT0800000008911C Badalona - Dalt … (2.26 41.46)
#> # ℹ 234 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 244 features and 9 fields
#> Geometry type: POINT
#> Dimension:     XY
#> Bounding box:  xmin: 1.58 ymin: 41.22 xmax: 2.74 ymax: 42.29
#> Geodetic CRS:  WGS 84
#> # A tibble: 244 × 10
#>    timestamp           service       station_id     station_name min_temperature
#>  * <dttm>              <chr>         <chr>          <chr>                   [°C]
#>  1 2023-12-19 14:25:00 meteoclimatic ESCAT08000000… Granollers …             3.5
#>  2 2023-12-19 14:29:00 meteoclimatic ESCAT08000000… Taradell (D…            -1.8
#>  3 2023-12-19 14:30:00 meteoclimatic ESCAT08000000… Vacarisses …            -3.2
#>  4 2023-12-19 14:30:00 meteoclimatic ESCAT08000000… Dosrius Can…            11.8
#>  5 2023-12-19 14:30:00 meteoclimatic ESCAT08000000… Sant Celoni…             1.3
#>  6 2023-12-19 14:30:00 meteoclimatic ESCAT08000000… La Pobla de…            -2  
#>  7 2023-12-19 14:31:00 meteoclimatic ESCAT08000000… Montmeló-T.…             0.6
#>  8 2023-12-19 14:34:00 meteoclimatic ESCAT08000000… Aiguafreda …            -0.2
#>  9 2023-12-19 14:37:00 meteoclimatic ESCAT08000000… El Prat-Zon…             7  
#> 10 2023-12-19 14:38:00 meteoclimatic ESCAT08000000… St Quirze d…             4.9
#> # ℹ 234 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 1 rows containing non-finite values (`stat_bin()`).