R/match_imgw_wmoid_inds.R

Defines functions match_imgw_wmoid_inds

#' Match WMO station IDs for IMGW SYNOP
#' @param station vector or station names provided to imgw_meteo_ family of functions
#' @keywords internal
#' @noRd
match_imgw_wmoid_inds = function(station) {
    if (is.null(station)) {
        return(NULL)
    }
    pattern_combined = paste(station, collapse = "|")
    ids_idx = grep(
        pattern = pattern_combined,
        x = climate::imgw_meteo_stations$station,
        ignore.case = TRUE
    )
    ids = climate::imgw_meteo_stations[ids_idx, "id2"]
    return(ids[nchar(ids) == 3])
}

Try the climate package in your browser

Any scripts or data that you put into this service are public.

climate documentation built on Jan. 23, 2026, 5:07 p.m.