| Title: | Fast Decoding of SYNOP (Surface Synoptic Observations) Meteorological Messages |
|---|---|
| Description: | Decode SYNOP (surface synoptic observations) messages into data frames, extracting data from Sections 0, 1, and 3, including temperature, dew point, pressure, wind, clouds, and precipitation. Available functions to download SYNOP messages from Ogimet <https://www.ogimet.com/> if needed. The decoding logic follows the specifications defined in the World Meteorological Organization (2019) "Manual on Codes, Volume I.1 (WMO-No. 306)". |
| Authors: | Ezequiel Elias [aut, cre] |
| Maintainer: | Ezequiel Elias <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.0.0 |
| Built: | 2026-05-14 09:27:54 UTC |
| Source: | https://github.com/ezequiel1593/synopr |
Validates if SYNOP strings meet basic structural requirements, considering section indicators and 5-digit data groups.
check_synop(data)check_synop(data)
data |
A character vector of SYNOP strings or the exact data frame
returned by |
A data frame with validation results for each message.
msg <- paste0("AAXX 01123 87736 32965 13205 10214 20143 ", "30022 40113 5//// 80005 333 10236 20128=") checked_synops <- check_synop(msg)msg <- paste0("AAXX 01123 87736 32965 13205 10214 20143 ", "30022 40113 5//// 80005 333 10236 20128=") checked_synops <- check_synop(msg)
Direct download of meteorological data from Ogimet
direct_download_from_ogimet(wmo_identifier, initial_date, final_date)direct_download_from_ogimet(wmo_identifier, initial_date, final_date)
wmo_identifier |
A 5-digit character string or integer representing the station WMO ID. |
initial_date |
Initial date, format "YYYY-MM-DD". |
final_date |
Final date, format "YYYY-MM-DD". |
The requested period cannot exceed 370 days. All queries assume UTC time zone.
The returned data frame covers from 00:00 UTC of the initial_date to 23:00 UTC
of the final_date, inclusive.
Too many requests may trigger temporal blocks.
If the station identifier starts with 0 (zero), then wmo_identifier must be a string (e.g., "06447").
A data frame, as returned by show_synop_data()
## Not run: direct_download_from_ogimet(wmo_identifier = '87585', initial_date = "2024-01-10", final_date = "2024-01-11") ## End(Not run)## Not run: direct_download_from_ogimet(wmo_identifier = '87585', initial_date = "2024-01-10", final_date = "2024-01-11") ## End(Not run)
Download SYNOP messages from Ogimet
download_from_ogimet(wmo_identifier, initial_date, final_date)download_from_ogimet(wmo_identifier, initial_date, final_date)
wmo_identifier |
A 5-digit character string or integer representing the station WMO ID. |
initial_date |
Initial date, format "YYYY-MM-DD". |
final_date |
Final date, format "YYYY-MM-DD". |
The requested period cannot exceed 370 days. All queries assume UTC time zone.
The returned dataset covers from 00:00 UTC of the initial_date to 23:00 UTC
of the final_date, inclusive.
Too many requests may trigger temporal blocks.
If the station identifier starts with 0 (zero), then wmo_identifier must be a string (e.g., "06447").
A character vector with SYNOP strings.
## Not run: download_from_ogimet(wmo_identifier = '87585', initial_date = "2024-01-10", final_date = "2024-01-11") ## End(Not run)## Not run: download_from_ogimet(wmo_identifier = '87585', initial_date = "2024-01-10", final_date = "2024-01-11") ## End(Not run)
Parse SYNOP strings downloaded from Ogimet into a data frame
parse_ogimet(ogimet_data)parse_ogimet(ogimet_data)
ogimet_data |
A character vector of Ogimet-format SYNOP strings. |
A data frame with Year, Month, Day, Hour, and Raw_synop.
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)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)
This function decodes a vector or data frame column of SYNOP strings belonging to the same or different meteorological surface station.
show_synop_data(data, wmo_identifier = NULL, remove_empty_cols = TRUE)show_synop_data(data, wmo_identifier = NULL, remove_empty_cols = TRUE)
data |
A character vector, a data frame column containing raw SYNOP strings, or the exact data frame returned by |
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 |
A data frame where each row represents one observation time and each column a decoded meteorological variable.
wmo_id - WMO station identifier
Year - (from parse_ogimet())
Month - (from parse_ogimet())
Day - As informed by Section 0
Hour - As informed by Section 0
Cloud_base_height - Lowest cloud base height, in intervals
Visibility - In meters
Total_cloud_cover - In oktas, 9 means 'invisible' sky by fog or other phenomenon
Wind_direction - In tens of degree, 99 means 'variable wind direction'
Wind_speed
Wind_speed_unit - Either 'm/s' or 'knots'
Air_temperature - In degrees Celsius
Dew_point - In degrees Celsius
Relative_humidity - As a percentage
Station_pressure - In hPa
MSLP_GH - Mean sea level pressure (in hPa) or geopotential height (in gpm)
Pressure_tendency - In hPa
Charac_pressure_tend - String, simplified decoding
Precipitation_S1 - In mm
Precip_period_S1 - In hours ('Precipitation_S1' fell in the last 'Precip_period_S1' hours)
Present_weather - String, simplified decoding
Past_weather1 - String, simplified decoding
Past_weather2 - String, simplified decoding
Cloud_amount_Nh - Cloud coverage from low or medium cloud, same as 'Total_cloud_cover'
Low_clouds_CL - String, simplified decoding
Medium_clouds_CM - String, simplified decoding
High_clouds_CH - String, simplified decoding
Max_temperature - In degrees Celsius
Min_temperature - In degrees Celsius
Ground_state - String, simplified decoding
Ground_temperature - Integer, in degrees Celsius
Snow_ground_state - String, simplified decoding
Snow_depth - In cm
Ev_Evt - Evaporation (ev) or evapotranspiration (evt), in mm
Sunshine_daily - In hours (generally from the previous civil day)
Positive_Net_Rad_last_24h - In J/cm^2
Negative_Net_Rad_last_24h - In J/cm^2
Global_Solar_Rad_last_24h - In J/cm^2
Diffused_Solar_Rad_last_24h - In J/cm^2
Downward_LongWave_Rad_last_24h - In J/cm^2
Upward_LongWave_Rad_last_24h - In J/cm^2
ShortWave_Rad_last_24h - In J/cm^2
Net_ShortWave_Rad_last_24h - In J/cm^2
Direct_Solar_Rad_last_24h - In J/cm^2
Sunshine_last_hour - In hours
Positive_Net_Rad_last_hour - In kJ/m^2
Negative_Net_Rad_last_hour - In kJ/m^2
Global_Solar_Rad_last_hour - In kJ/m^2
Diffused_Solar_Rad_last_hour - In kJ/m^2
Downward_LongWave_Rad_last_hour - In kJ/m^2
Upward_LongWave_Rad_last_hour - In kJ/m^2
ShortWave_Rad_last_hour - In kJ/m^2
Net_ShortWave_Rad_last_hour - In kJ/m^2
Direct_Solar_Rad_last_hour - In kJ/m^2
Cloud_drift_direction - In cardinal and intercardinal directions for "low - medium - high" clouds
Cloud_elevation_direction - String indicating genera, direction and elevation angle
Pressure_change_last_24h - In hPa
Precipitation_S3 - In mm
Precip_period_S3 - In hours ('Precipitation_S3' fell in the last 'Precip_period_S3' hours)
Precipitation_last_24h - In mm
Cloud_layer_1 - String indicating cover, genera and height
Cloud_layer_2 - String indicating cover, genera and height
Cloud_layer_3 - String indicating cover, genera and height
Cloud_layer_4 - String indicating cover, genera and height
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)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)