windkit.io.wasp.read_gwc#

windkit.io.wasp.read_gwc(filepath)[source]#

Read a WAsP .gwc file and return parsed data.

The RveaGeneralisedMeanWindClimate element may be the document root or nested anywhere below it. The horizontal position, the height and the description come from the element itself when it carries them, and otherwise from a RveaAnemometerSiteDetails element anywhere in the file. The position is taken from one source as a pair; an element that gives only a latitude is not completed with the site’s longitude. An empty element Description defers to a non-empty site one.

Parameters:

filepath (str or Path) – Path to the .gwc file.

Returns:

See parse_gwc_element().

Return type:

dict

Raises:
  • lxml.etree.XMLSyntaxError – If the file is not well-formed XML. Subclasses SyntaxError.

  • ValueError – If the file holds no RveaGeneralisedMeanWindClimate element, or a required element or attribute is missing, as described in parse_gwc_element().