windkit.spatial.create_dataset

windkit.spatial.create_dataset(west_east, south_north, height, crs, struct='auto', thresh=1e-09)[source]

Create a WindKit dataset given a set of locations.

Parameters:
  • west_east (array_like) – 1D array of west_east locations of interest

  • south_north (array_like) – 1D array of south_north locations of interest

  • height (array_like) – Array of heights to create in output WindKit xarray dataset

  • crs (int, dict, str or pyproj.crs.CRS) – Value to initialize pyproj.crs.CRS

  • struct (str) – Used to specify the type of dataset that is desired Valid values are ‘auto’, ‘cuboid’, ‘point’ and ‘stacked_point’. The default value of ‘auto’ tries to create a cuboid, but falls back to point depending on the values specified.

  • thresh (float) – Threshold value for raster detection Default set to 1e-9 m

Returns:

WindKit formated zero-filled Dataset with one variable “output” and with the grid dimensions specified

Return type:

xarray.Dataset

Notes

This function will create a WindKit formatted dataset including all of the geospatial information that is desired.

If ds_fmt is set to “auto”, the function will attempt to create a cuboid, if the deviation between the largest and smallest interval along west_east and south_north are lower than value in thresh (west_east and south north can be different lengths). Otherwise, the function will attempt to make a point dataset. Specifically, it will create a 3D point object, if west_east, south_north and heights have the same lengths. If west_east and south_north have the same lengths but heights length is different the function will create a 2D point object.

Alternatively, ds_fmt can be set to desired output format, that is ‘cuboid’, ‘stacked_point’ and ‘point’, which accordingly requires specific structures of west_east, south_north and heights (as described above):

  • cuboid:

    west_east, south_north, and heights must contain unique points along their dimension, and west_east and south_north are evenly spaced

  • stacked_point:

    west_east and south_north must have the same length, but heights will have unique values representing the dimension values

  • point:

    west_east, south_north and heights must have same lengths