windkit.workspace.Workspace.get_gwc

Workspace.get_gwc(ID, crs=None, west_east=None, south_north=None, height=None, header=None)[source]

Converts XML representation of gwc to WindKit gwc data structure.

Parameters:
  • ID (int) – ID of gwc object in .wwh file.

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

  • west_east (float or None, optional) – x- and y-coordinates of gwc location. Defaults to None, which means the coordinates are taken from the met mast location or the file. If the met mast location is not available, an error is raised.

  • south_north (float or None, optional) – x- and y-coordinates of gwc location. Defaults to None, which means the coordinates are taken from the met mast location or the file. If the met mast location is not available, an error is raised.

  • height (float or None, optional) – Height of gwc location. Defaults to None, which means the height is taken from the met mast location or the file. If the met mast location is not available, the height is set to 0 m.

  • header (str or None, optional) – Header of gwc. Defaults to None, which means the header is attempted to be taken from the met mast or the file.

Returns:

xarray Dataset that is formatted to match the gwc description.

Return type:

xarray.Dataset

Raises:
  • ValueError – If the ID does not exist in the catalogue.

  • ValueError – If the ID is not linked to a gwc.

  • ValueError – If the mast location is not available and the coordinates are not provided.

  • ValueError – If no CRS is provided and the file does not contain a CRS.

Warns:

UserWarning – If no height is provided and the mast location is not available. The height is set to 0 m.