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:
- Raises:
WindkitFileFormatError – If
CountOfSectorsis absent or not an integer; ifRveaAnemometerSiteDetailsor one of itsLatitudeDegrees,LongitudeDegrees,HeightAGLorDescriptionattributes is absent; if there is noObservedWindelement; if the first sector’sNumberOfBinsis absent or negative; if anObservedWindhas noSpeedFrequencyDistribution, anIndexoutside1..CountOfSectorsor one already used, or a number of bins that differs from the first sector’sNumberOfBins; or if a numeric attribute does not parse.