.. _wind_turbines: Wind Turbines ============= Wind Turbine Generator ^^^^^^^^^^^^^^^^^^^^^^ Wind Turbine Generators (WTGs) A `.wtg` file can be read using the :py:func:`windkit.read_wtg` function. .. code-block:: python import windkit as wk wtg = wk.read_wtg("Bonus_1_MW.wtg") print(wtg) .. code-block:: bash Dimensions: (mode: 1, wind_speed: 22) Coordinates: * wind_speed (wind_speed) float64 4.0 5.0 ... 24.0 25.0 * mode (mode) int64 0 Data variables: power_output (mode, wind_speed) float64 2.41e+04 ... 1e+06 thrust_coefficient (mode, wind_speed) float64 0.915 ... 0.161 air_density (mode) float64 1.225 stationary_thrust_coefficient (mode) float64 0.161 wind_speed_cutin (mode) float64 4.0 wind_speed_cutout (mode) float64 25.0 rated_power (mode) float64 1e+06 name ` by creating a a :py:class:`xr.Dataset` object containing information about the positions, hub height, turbine id's, turbine group id's, and wtg keys for each turbine. The wtg keys are used to map from each turbine to a WTG :py:class:`xr.Dataset` via a dictionary object. The turbines :py:class:`xr.Dataset` can be created via the functions :py:func:`windkit.create_wind_turbines_from_arrays`, :py:func:`windkit.create_wind_turbines_from_dataframe`, or :py:func:`windkit.wind_turbines_to_geodataframe`. Here is a simple example of how to create the turbines :py:class:`xr.Dataset`: .. code-block:: python import windkit as wk turbines = wk.create_wind_turbines_from_arrays( x=[0, 0, 0, 0, 0], y=[0, 1, 2, 3, 4], height=[50, 50, 50, 50, 50], crs="epsg:32632", turbine_ids=[1, 2, 3, 4, 5], group_ids=[0, 0, 1, 1, 1], wtg_keys=["wtg1", "wtg1", "wtg2", "wtg2", "wtg2"], ) In this example, we have defined five turbines in two groups, with each group using a different WTG. The wtg keys ("wtg1" and "wtg2"), should exist in a dictionary that maps to the WTG :py:class:`xr.Dataset`'s: ``{"wtg1": wtg1, "wtg2": wtg2}``.