windkit.io.windio.tswc_to_windio#

windkit.io.windio.tswc_to_windio(tswc, level='plant')[source]#

Convert windkit Time Series Wind Climate to windIO data structure.

Warning

windIO support is experimental. API may change in future versions.

Handles both point and stacked_point spatial structures. For stacked_point datasets (with height dimension), the height information is preserved in the windIO output.

Parameters:
  • tswc (xarray.Dataset) – Time Series Wind Climate dataset with point or stacked_point structure.

  • level (str) –

    Export level controlling what part of the windIO structure to return. Options:

    • ’plant’: Complete plant structure (default)

    • ’site’: Site dict with boundaries and energy_resource

    • ’energy_resource’: Energy resource dict with wind_resource

    • ’wind_resource’: Just the wind_resource dict with climate data

Returns:

Dictionary at the specified level of the windIO schema structure.

Return type:

dict

Raises:

ValueError – If level is not one of the valid options.

Examples

>>> import windkit as wk
>>> from windkit.io.windio.translate import tswc_to_windio
>>> tswc = wk.read_tswc("timeseries.csv", crs="EPSG:32632")
>>>
>>> # Full plant structure (default)
>>> plant_data = tswc_to_windio(tswc)
>>>
>>> # Just the wind_resource dict
>>> wind_resource = tswc_to_windio(tswc, level="wind_resource")