windkit.read_bwc#

windkit.read_bwc(filename, *, crs=None, file_format='infer', wind_dir_crs=None, **kwargs)[source]#

Creates binned wind climate xarray.Dataset from file.

Parameters:
  • filename (str or Path) – Path to a file that can be opened as a bwc. This includes .tab, .owc, .omwc, and .nc that were created as bwc files. The script will use the file extension to determine the file type and then parse it into a bwc DataSet object.

  • crs (int, dict, str or pyproj.crs.CRS) – Value to initialize pyproj.crs.CRS Defaults to 4326 (Lat-Lon/WGS84 geodetic datum) for .tab, .owc and .omwc files.

  • file_format (str) – The file format of the input file. If ‘infer’, the file format will be inferred from the file extension. Supported formats are ‘tab’, ‘owc’, ‘omwc’, ‘nc’, ‘yml’, and ‘yaml’. Defaults to ‘infer’.

  • wind_dir_crs (CRS-like, optional) – CRS that defines the wind-direction frame of the returned BWC. A projected CRS denotes grid north and a geographic CRS denotes true north.

  • **kwargs (dict) – Additional arguments to be passed to the file reader. For windIO files, the ‘level’ argument can be specified to indicate the windIO hierarchy level.

Returns:

ds – binned wind climate dataset that is formatted to match the bwc description.

Return type:

xarray.Dataset

Raises: