windkit.get_tutorial_data#

windkit.get_tutorial_data(name, force_download=False)[source]#

Download and extract tutorial data, returning the path to the folder.

Downloads tutorial data from Zenodo if not already cached, extracts it, and returns the path to the extracted folder. Use load_tutorial_data to load the files into memory as windkit objects.

The local cache is stored in the user data directory under the name “windkit”. On Windows, this is typically located at:

C:\Users\<username>\AppData\Roaming\windkit\tutorial_data

On Linux, it is typically located at:

/home/<username>/.local/share/windkit/tutorial_data

You can check the location of the user data directory using the user_data_dir function from the platformdirs package.

Available Datasets#

serra_santa_luzia

A wind farm site in Portugal with 15 turbines. Contains the following files:

  • bwc.nc - Binned Wind Climate (xarray.Dataset)

    Single-point observed wind climate with 12 sectors and 32 wind speed bins. Use with xr.load_dataset() or wk.read_bwc().

  • wtg.nc - Wind Turbine Generator (xarray.Dataset)

    Bonus 1 MW turbine with power curve and thrust coefficient. Use with xr.load_dataset() or wk.read_wtg().

  • turbines.nc - Wind Turbines (xarray.Dataset)

    15 turbine positions with coordinates and WTG assignments. Use with xr.load_dataset() or wk.read_wind_turbines().

  • elev.gpkg - Elevation Map (geopandas.GeoDataFrame)

    Elevation contour lines for the site terrain. Use with gpd.read_file() or wk.read_elevation_map().

  • rgh.gpkg - Roughness Map (geopandas.GeoDataFrame)

    Land cover roughness polygons for the site. Use with gpd.read_file() or wk.read_roughness_map().

  • bwc.omwc - Observed Wind Climate (WAsP OMWC format)

    Use with wk.read_bwc().

  • Bonus1MW.wtg - Wind Turbine Generator (WAsP WTG format)

    Use with wk.read_wtg().

  • SerraSantaLuzia.map - Combined Map (WAsP MAP format)

    Elevation and roughness data in WAsP vector format. Use with wk.read_elevation_map() or wk.read_roughness_map().

  • turbines.csv - Turbine positions (CSV format)

    Use with wk.read_wind_turbines().

param name:

Name of the dataset to download. Currently available: “serra_santa_luzia”.

type name:

str

param force_download:

If True, forces re-download and re-extraction even if data already exists. Default is False.

type force_download:

bool, optional

returns:

Path to the folder containing the extracted tutorial data files.

rtype:

Path

raises ValueError:

If the name is not a valid dataset name.

raises ConnectionError:

If there is no internet connection when trying to download the data.

raises RuntimeError:

If the download fails or the status code is not 200.

Examples

>>> import windkit as wk
>>> path = get_tutorial_data("serra_santa_luzia")
>>> path
PosixPath('/home/user/.local/share/windkit/tutorial_data/serra_santa_luzia/extracted')
>>> bwc = wk.read_bwc(path / "bwc.omwc")
>>> bwc
<xarray.Dataset> Size: 4kB
Dimensions:       (point: 1, sector: 12, wsbin: 32)
...

See also

load_tutorial_data

Load tutorial data files directly into memory.