windkit.io.wasp.parse_wwh_member_element#

windkit.io.wasp.parse_wwh_member_element(member, context='WWH member')[source]#

Parse one WaspHierarchyMember element of a workspace inventory.

Only the member’s own data and settings are read, not those of the members in its ChildMembers. Only the .tag / .attrib / .find / .findall / .iter / .text subset of the ElementTree interface is used, so both lxml.etree and xml.etree.ElementTree elements are accepted.

Parameters:
  • member (lxml.etree._Element or xml.etree.ElementTree.Element) – A <WaspHierarchyMember> element.

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

Returns:

Dictionary with keys:

  • "id" : str, the member’s GUID as written, braces included

  • "class_id" : int

  • "class_description" : str, e.g. "Turbine site"

  • "description" : str, the member’s name as written (WAsP may leave trailing spaces)

  • "results_dirty" : dict mapping each calculation of the member’s CalculationInformation ("Calculation1", …) to True when WAsP marked its results as not up to date; empty when there is none

  • "coords" : dict with "west_east", "south_north" and "height" (working height above ground) of a site, from SiteInformation

  • "site_assessment" : dict of the site effects, from SiteAssessment, with arrays of shape (n_sectors,): "sector" (centre angles in degrees), "z0meso", "slfmeso", "displ", "roughness_changes" (int), "roughness_speedups", "roughness_turnings", "orographic_speedups", "orographic_turnings", "obstacle_speedups", "obstacle_turnings" and "dirrix"; and floats "site_elev", "rix" and "site_roughness". "sector", "z0meso", "slfmeso", the obstacle effects and "site_elev" are required; the others are None when not stored. The CFD Turbulence and FlowInclination attributes are not read.

  • "predicted_wind_climate" : dict with arrays of shape (n_sectors,) "sector", "sector_width", "A", "k" and "wdfreq", and the float "air_density" (None when not stored, as in format 3.03), from PredictedWindClimate

  • "observed_wind_climate_weibull_fit" : dict with the same arrays, WAsP’s Weibull fit of the observed wind climate, from ObservedWindClimateWeibullRose

  • "production" : dict with arrays of shape (n_sectors,) "sector", "wdfreq", "gross" and "net" (Wh/y) and "wake_loss" (0-1); and floats "sum_of_sectors_gross", "sum_of_sectors_net" and "omnidirectional_gross" (Wh/y), from Production

  • "observed_wind_climate" : dict, see parse_owc_element()

  • "generalized_wind_climate" : dict, see parse_gwc_element()

  • "wind_turbine_generator" : dict, see parse_wtg_element()

  • "data_layer" : dict with "phenomenon" (e.g. "ElevationContours") and "archive_file" (the archive entry holding the layer), each None when not stored

  • "parameters" : dict mapping the ID of each parameter in Settings/RveaConfiguration (e.g. "DSECTORS") to a dict with "value" (float, or the raw string when it is not a number) and "is_default" (bool)

  • "profile_model_parameters" : the same, for the parameters a generalised wind climate records in Provenance/ProfileModelParameters

  • "wake_modelling" : dict with "is_active" (bool), "model" (str), "n_sub_sectors" (int), "speed_resolution" and "default_decay_coefficient" (floats) and "decay_coefficient" (array, shape (n_sectors,)); all but "is_active" are None when not stored

  • "air_density_correction" : dict with "svenningsen_factor" (float) and "table_air_density" (array, the air densities of the performance tables used), each None when not stored

A part the member does not hold is None.

Return type:

dict

Raises:
  • WindkitFileFormatError – If ID, ClassID, ClassDescription or Description is absent or unparseable; or if a part that is present lacks a required element or attribute, holds a number or flag that does not parse, or has a sector Index outside 1..CountOfSectors, repeated, or missing, or a parameter ID repeated.

  • ValueError – If the generalised wind climate is malformed, as described in parse_gwc_element().