windkit.io.wasp.read_tab#

windkit.io.wasp.read_tab(filepath, encoding='infer')[source]#

Read a .tab file and return parsed data with normalized frequencies.

Parameters:
  • filepath (str or Path) – Path to the .tab file.

  • encoding (str, optional) – File encoding. If “infer”, the encoding is detected automatically. Defaults to “infer”.

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 the encoding cannot be detected; if the coordinate line does not hold three numbers; if a header, sector frequency or wind speed value is not a number; if the tabfile type is not supported; or if no wind speed rows follow the sector frequency line.