Title: Tidy Decoding of SYNOP (Surface Synoptic Observations) Meteorological Messages
Version: 0.2.2
Description: Decode raw SYNOP (surface synoptic observations) messages into tidy data frames. Supports batch processing of messages from the same station, extracting data from Sections 0, 1, and 3, including temperature, dew point, pressure, wind, clouds, and precipitation. The decoding logic follows the specifications defined in the World Meteorological Organization (2019) "Manual on Codes, Volume I.1 (WMO-No. 306)" https://library.wmo.int/idurl/4/35713.
License: MIT + file LICENSE
Encoding: UTF-8
RoxygenNote: 7.3.3
Imports: dplyr, stringr, tidyr, purrr
Suggests: knitr, rmarkdown, testthat (≥ 3.0.0)
URL: https://ezequiel1593.github.io/synopR/
BugReports: https://github.com/ezequiel1593/synopR/issues
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2026-03-13 13:14:27 UTC; eleze
Author: Ezequiel Elias [aut, cre]
Maintainer: Ezequiel Elias <elezeru15@gmail.com>
Depends: R (≥ 4.1.0)
Repository: CRAN
Date/Publication: 2026-03-18 10:30:07 UTC

Check SYNOP messages for structural integrity

Description

Validates if SYNOP strings meet basic structural requirements, considering section indicators and 5-digit data groups.

Usage

check_synop(data)

Arguments

data

A character vector of SYNOP strings or the exact data frame returned by parse_ogimet().

Value

A tibble with validation results for each message.

Examples

msg <- paste0("AAXX 01123 87736 32965 13205 10214 20143 ",
              "30022 40113 5//// 80005 333 10236 20128=")
checked_synops <- check_synop(msg)

Parse Ogimet strings into a data frame

Description

Parse Ogimet strings into a data frame

Usage

parse_ogimet(ogimet_data)

Arguments

ogimet_data

A character vector of Ogimet strings.

Value

A tibble with Year, Month, Day, Hour, and Raw_synop.

Examples

msg <- paste0("87736,2026,01,01,12,00,AAXX 01123 87736 32965 13205 10214 20143 ",
              "30022 40113 5//// 80005 333 10236 20128=")
parsed_data <- parse_ogimet(msg)

Decode multiple SYNOP messages from a single station

Description

This function decodes a vector or data frame column of raw SYNOP strings belonging to the same WMO station. It efficiently processes multiple observations at once, returning a tidy data frame.

Usage

show_synop_data(data, wmo_identifier = NULL, remove_empty_cols = FALSE)

Arguments

data

A character vector, or a data frame or tibble with one column containing raw SYNOP strings.

wmo_identifier

A 5-digit character string or integer representing the station WMO ID. If NULL (default), all messages are decoded.

remove_empty_cols

Logical. Should columns containing only NA values be removed?

Value

A tidy tibble where each row represents one observation time and each column a decoded meteorological variable.

  1. wmo_id - WMO station identifier

  2. Year - (from parse_ogimet())

  3. Day - As informed by Section 0

  4. Hour - As informed by Section 0

  5. Cloud_base_height - Lowest cloud base height, not decoded

  6. Visibility - Not decoded

  7. Total_cloud_cover - In oktas, 9 means 'invisible' sky by fog or other phenomenon

  8. Wind_direction - In tens of degree, 99 means 'variable wind direction'

  9. Wind_speed

  10. Wind_speed_unit - Either 'm/s' or 'knots'

  11. Air_temperature - In degrees Celsius

  12. Dew_point - In degrees Celsius

  13. Relative_humidity - As a percentage

  14. Station_pressure - In hPa

  15. MSLP_GH - Mean sea level pressure (in hPa) or geopotential height (in gpm)

  16. Present_weather - Not decoded

  17. Past_weather1 - Not decoded

  18. Past_weather2 - Not decoded

  19. Precipitation_S1 - In mm

  20. Precip_period_S1 - In hours ('Precipitation_S1' fell in the last 'Precip_period_S1' hours)

  21. Cloud_amount_Nh - Cloud coverage from low or medium cloud, same as 'Total_cloud_cover'

  22. Low_clouds_CL - Not decoded

  23. Medium_clouds_CM - Not decoded

  24. High_clouds_CH - Not decoded

  25. Max_temperature - In degrees Celsius

  26. Min_temperature - In degrees Celsius

  27. Ground_state - Not decoded

  28. Ground_temperature - Integer, in degrees Celsius

  29. Snow_ground_state - Not decoded

  30. Snow_depth - In cm, is assumed to be between 1 and 996 cm

  31. Precipitation_S3 - In mm

  32. Precip_period_S3 - In hours ('Precipitation_S3' fell in the last 'Precip_period_S3' hours)

Examples

msg <- paste0("AAXX 01123 87736 32965 13205 10214 20143 ",
              "30022 40113 5//// 80005 333 10236 20128 56000 81270=")
synop_df <- data.frame(messages = msg)
decoded_data <- show_synop_data(synop_df, "87736")