windkit.read_wind_turbines#

windkit.read_wind_turbines(filename, *, crs=None, file_format='infer', level='plant', **kwargs)[source]#

Read wind turbine locations from a file.

Parameters:
  • filename (str or Path) – Path to the file to read. Supported formats: csv and yaml (windIO).

  • crs (int, dict, str or pyproj.crs.CRS) – Coordinate reference system. Required for CSV and windIO YAML files.

  • file_format (str) – File format. If ‘infer’, the format is determined from the file extension. Supported formats: ‘csv’ and ‘yaml’ (windIO).

  • level (str) – For windIO format only: the hierarchy level of the input file (‘plant’, ‘wind_farm’, or ‘layout’). Defaults to ‘plant’.

  • **kwargs (dict) – Additional arguments passed to the file reader.

Returns:

Wind turbines dataset with point spatial structure.

Return type:

xarray.Dataset

Raises:

ValueError – If the file format is not supported. If CRS is required but not provided.

Examples

>>> import windkit as wk
>>> turbines = wk.read_wind_turbines("wind_farm.yaml", crs="EPSG:32632")
>>> # Read from a standalone layout file
>>> turbines = wk.read_wind_turbines("layout.yaml", crs="EPSG:32632", level="layout")