windkit.create_bwc#

windkit.create_bwc(output_locs, n_sectors=12, n_wsbins=30, not_empty=True, seed=9876538, wind_dir_crs=None, wsbin_width=1.0, weibull_A=None, weibull_k=None)[source]#

Create empty binned wind climate dataset.

If not_empty=True, the data variables are filled with meaninful random numbers, e.g. the sum of wdfreq is 1.

Parameters:
  • output_loc (xarray.Dataset) – Output geospatial information.

  • n_sectors (int) – Number of sectors, defaults to 12.

  • n_wsbins (int) – Number of histogram bins, defaults to 30.

  • not_empty (bool) – If true, the empty dataset is filled with random meaningful data.

  • seed (int) – Seed for the random data, defaults to 9876538.

  • wind_dir_crs (CRS-like, optional) – CRS that defines the wind-direction frame. A projected CRS denotes grid north and a geographic CRS denotes true north.

  • wsbin_width (float) – Width of each wind speed bin [m s-1], defaults to 1.0.

  • weibull_A (float, tuple of float, or None) – Weibull scale parameter [m s-1]. A scalar pins it, a (low, high) pair draws it per point and sector, and None uses the default range (5, 10).

  • weibull_k (float, tuple of float, or None) – Weibull shape parameter, resolved the same way. Defaults to the range (1.5, 2.5).

Returns:

ds – Binned wind climate dataset either empty or filled with random numbers.

Return type:

xarray.Dataset

Notes

wsfreq and wdfreq are stored float32, C-contiguous, with (sector, wsbin) trailing the spatial batch dimensions — the reverse of weibull_fit_points’ declared wsfreq(nws, nwd, npoints) — so PyWAsP’s compiled boundary can take a Fortran-ordered view instead of converting a copy (windkit#807). Neither the dtype nor the dimension order is a supported API contract: create_bwc is a test-data utility.