windkit.io.wasp.parse_owc_element#

windkit.io.wasp.parse_owc_element(owc, context='OWC element')[source]#

Parse an lxml XML element for an observed wind climate.

Parameters:
  • owc (lxml.etree._Element) – The <RveaObservedWindClimate> root element.

  • context (str, optional) – Identifier used in error messages, typically the source file path.

Returns:

Dictionary with keys: - “wsfreq”: ndarray(n_wsbins, n_sectors) - wind speed frequencies (0-1) - “wdfreq”: ndarray(n_sectors) - wind direction frequencies (0-1) - “wsbins”: ndarray(n_wsbins+1) - wind speed bin edges - “coords”: dict with “south_north”, “west_east”, “height” - “metadata”: dict with “description”

Return type:

dict

Raises:

WindkitFileFormatError – If CountOfSectors is absent or not an integer; if RveaAnemometerSiteDetails or one of its LatitudeDegrees, LongitudeDegrees, HeightAGL or Description attributes is absent; if there is no ObservedWind element; if the first sector’s NumberOfBins is absent or negative; if an ObservedWind has no SpeedFrequencyDistribution, an Index outside 1..CountOfSectors or one already used, or a number of bins that differs from the first sector’s NumberOfBins; or if a numeric attribute does not parse.