.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/bwc_to_wwc.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_bwc_to_wwc.py: BWC to WWC ==================== This example demonstrates how to convert a binned wind climate (BWC) object to a weibull wind climate (WWC) object using the :py:func:`weibull_fit` function from the :ref:`windkit` library. .. GENERATED FROM PYTHON SOURCE LINES 12-15 Get Sample Data ------------------------ First, we fetch some sample data from the Serra Santa Luzia case. .. GENERATED FROM PYTHON SOURCE LINES 15-23 .. code-block:: Python import windkit as wk ssl = wk.get_tutorial_data("serra_santa_luzia") bwc = ssl.bwc print(bwc) .. rst-class:: sphx-glr-script-out .. code-block:: none Downloading SerraSantaLuzia.zip from Zenodo... Downloaded SerraSantaLuzia.zip to /root/.local/share/windkit/tutorial_data/serra_santa_luzia/SerraSantaLuzia.zip Size: 4kB Dimensions: (point: 1, sector: 12, wsbin: 32) Coordinates: height (point) float64 8B 25.3 crs int8 1B 0 wsceil (wsbin) float64 256B 1.0 2.0 3.0 4.0 ... 29.0 30.0 31.0 32.0 wsfloor (wsbin) float64 256B 0.0 1.0 2.0 3.0 ... 28.0 29.0 30.0 31.0 sector_ceil (sector) float64 96B 15.0 45.0 75.0 ... 285.0 315.0 345.0 sector_floor (sector) float64 96B 345.0 15.0 45.0 ... 255.0 285.0 315.0 * wsbin (wsbin) float64 256B 0.5 1.5 2.5 3.5 ... 28.5 29.5 30.5 31.5 * sector (sector) float64 96B 0.0 30.0 60.0 90.0 ... 270.0 300.0 330.0 west_east (point) float64 8B 5.147e+05 south_north (point) float64 8B 4.621e+06 Dimensions without coordinates: point Data variables: wdfreq (sector, point) float64 96B 0.05314 0.03321 ... 0.1148 0.0707 wsfreq (wsbin, sector, point) float64 3kB 0.02601 0.04219 ... 0.0 0.0 Attributes: Conventions: CF-1.8 history: 2025-04-27T14:55:55+00:00:\twindkit==0.8.2.dev22+g4fd01... description: SerraSantaluzia Package name: windkit Package version: 0.8.2.dev22+g4fd0143 Creation date: 2025-04-27T14:55:55+00:00 Object type: Binned Wind Climate author: Bjarke Tobias OLsen author_email: btol@dtu.dk institution: DTU Wind Energy .. GENERATED FROM PYTHON SOURCE LINES 24-27 Convert BWC to WWC ------------------------ Now, we can convert the binned wind climate (BWC) object to a weibull wind climate (WWC) object .. GENERATED FROM PYTHON SOURCE LINES 27-30 .. code-block:: Python wwc = wk.weibull_fit(bwc) print(wwc) .. rst-class:: sphx-glr-script-out .. code-block:: none Size: 601B Dimensions: (sector: 12, point: 1) Coordinates: height (point) float64 8B 25.3 crs int8 1B 0 sector_ceil (sector) float64 96B 15.0 45.0 75.0 ... 285.0 315.0 345.0 sector_floor (sector) float64 96B 345.0 15.0 45.0 ... 255.0 285.0 315.0 west_east (point) float64 8B 5.147e+05 south_north (point) float64 8B 4.621e+06 * sector (sector) float64 96B 0.0 30.0 60.0 90.0 ... 270.0 300.0 330.0 Dimensions without coordinates: point Data variables: wdfreq (sector, point) float64 96B 0.05314 0.03321 ... 0.1148 0.0707 A (sector, point) float64 96B 5.47 5.346 5.746 ... 7.312 6.022 k (sector, point) float64 96B 1.924 2.145 2.594 ... 2.185 1.97 Attributes: Conventions: CF-1.8 history: 2025-04-27T14:55:55+00:00:\twindkit==0.8.2.dev22+g4fd01... description: SerraSantaluzia Package name: windkit Package version: 1.0.2 Creation date: 2025-07-21T09:49:26+00:00 Object type: Weibull Wind Climate author: Default User author_email: default_email@example.com institution: Default Institution .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 3.035 seconds) .. _sphx_glr_download_auto_examples_bwc_to_wwc.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: bwc_to_wwc.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: bwc_to_wwc.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: bwc_to_wwc.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_