The DWD MOSMOX forecasts are provided as XML files. The "header" of the XML file contains some information about the MOSMIX model, initialization time, and so far and so on. This method extracts the meta information.

get_meta_info(doc)

# S3 method for dwdmeta
print(x, ...)

Arguments

doc

an XMLInternalDocument object as returned by xmlParse (XML package).

x

an object of class dwdmeta as returned by get_meta_info.

...

forwarded to S3 methods. Unused for now.

Value

Returns an object of class dwdmeta.

Details

Extracts the following information from the XML file:

  • Issuer who created these forecasts.

  • ProductID

  • GeneratingProcess

  • IssueTime the initialization time (most important information). Will also be used when creating the output files (see write_ascii).

  • ReferencedModel the NWP models the MOS is based on.

See also

get_station_information, get_meta_info, get_datetime.

Examples

# Latest L-type DWD MOSMIX forecast file for Innsbruck Airport url <- "https://opendata.dwd.de/weather/local_forecasts/mos/MOSMIX_L/single_stations/11120/kml/MOSMIX_L_LATEST_11120.kmz" # Download and extract file kmz <- tempfile("mosmix_demo_", fileext = ".kmz") check <- download.file(url, kmz) if ( inherits(check, "try-error") ) stop("Problems downloading the file!") kml <- unzip(kmz) # Parsing the unzipped kml file (XML format) doc <- XML::xmlParse(kml) # Extracting meta information meta <- get_meta_info(doc) print(meta)
#> [1] "Issuer: Deutscher Wetterdienst" #> [2] "ProductID: MOSMIX" #> [3] "GeneratingProcess: DWD MOSMIX hourly, Version 1.0" #> [4] "IssueTime: 2019-01-09 21:00:00 UTC" #> [5] "ReferencedModel(s)" #> [6] "- 2019-01-09 12:00:00 UTC, ICON" #> [7] "- 2019-01-09 12:00:00 UTC, ECMWF/IFS" #> attr(,"class") #> [1] "dwdmeta.print"
# Remove kmz and kml file file.remove(kmz, kml)
#> [1] TRUE TRUE