windkit.io.windio.export_site#
- windkit.io.windio.export_site(path, wwc=None, bwc=None, tswc=None, name='site', wind_resource_format='netcdf')[source]#
Export a windkit wind climate dataset to a windIO site YAML.
Warning
windIO support is experimental. API may change in future versions.
Converts the given wind climate to windIO format, computes site boundaries from the dataset’s spatial extent, and writes the result to YAML.
- Parameters:
path (str or pathlib.Path) – Output file path (e.g.
"output_dir/site.yaml").wwc (xarray.Dataset, optional) – Weibull Wind Climate dataset. Mutually exclusive with bwc and tswc.
bwc (xarray.Dataset, optional) – Binned Wind Climate dataset. Mutually exclusive with wwc and tswc.
tswc (xarray.Dataset, optional) – Time Series Wind Climate dataset. Mutually exclusive with wwc and bwc.
name (str) – Name for the site (default:
"site").wind_resource_format (str, optional) –
How to store the wind_resource data. Default is
"netcdf"."netcdf"— wind_resource is written aswind_resource.ncnext to the YAML file and referenced via!include."yaml"— wind_resource data is embedded inline (single-file output).
- Raises:
ValueError – If wind_resource_format is not
"netcdf"or"yaml".ValueError – If zero or more than one wind climate is provided.
Examples
>>> from windkit.io.windio import export_site >>> export_site("output_dir/site.yaml", wwc=wwc) >>> # Creates: output_dir/site.yaml, output_dir/wind_resource.nc
Single-file YAML output:
>>> export_site("output_dir/site.yaml", wwc=wwc, wind_resource_format="yaml") >>> # Creates: output_dir/site.yaml (with inline wind_resource)