get_meta_info.Rd
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, ...)
doc | an |
---|---|
x | an object of class |
... | forwarded to S3 methods. Unused for now. |
Returns an object of class dwdmeta
.
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.
get_station_information, get_meta_info, get_datetime.
# 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"#> [1] TRUE TRUE