pywasp.wasp.generalize_from_site_effects_to_geowc#

pywasp.wasp.generalize_from_site_effects_to_geowc(bwc, site_effects, conf=None, mesoclimate=None, mesoclimate_interp_method='nearest', return_site_effects=True, as_wv_count=True, n_gbins=500, rotate_to_true_north=False)[source]#

Creates a geostrophic wind climate

Warning

This function is experimental and its signature may change.

Parameters:
  • bwc (xarray.Dataset) – PyWAsP xr.Dataset containing wind climate to be generalized

  • site_effects (xarray.Dataset) – Site effects dataset

  • conf (Config) – PyWAsP configuration object

  • mesoclimate (xarray.Dataset, optional) – Mesoclimate at the site locations, e.g. from pywasp.wasp.get_climate(). If None, it is looked up from the sources selected by conf, using mesoclimate_interp_method. A supplied mesoclimate is matched by position, not by location or CRS: it needs one point per horizontal location, in the order in which the locations first appear, or one point per location and height, in the order of the points. get_climate on those locations gives exactly that.

  • mesoclimate_interp_method (str, optional) – Interpolation method for the mesoclimate lookup, by default ‘nearest’. Not applied to a supplied mesoclimate.

  • return_site_effects (bool, optional) – If True, return site factors along with the wind climate data

  • as_wv_count (bool) – return the wind climate as a wv_count object or as a standard binned wind climate

  • n_gbins (int, optional) – Number of bins for the wind speed distribution, by default 500

  • rotate_to_true_north (bool, optional) – Whether to rotate the input BWC wind directions from the projected grid reference frame to true north before generalizing. When False (default), no rotation is applied; the output GeoWC is in the input-grid reference frame and its wind_dir_crs attribute stores the CRS WKT of that projection so a subsequent downscale_* call can compute the effective rotation automatically. When True, the meridian convergence attached by get_site_effects is used to rotate the BWC to true north; the output GeoWC stores the geodetic (geographic) CRS WKT in the wind_dir_crs attribute (true-north reference frame).

Returns:

geo_wc (xarray.Dataset) – PyWAsP geostrophic wind climate. Always contains a wind_dir_crs attribute that records the reference frame of the stored wind directions: a geodetic/geographic CRS WKT string means a rotation was applied to true north; a projected CRS WKT string means the GeoWC is in that projection’s grid-north reference frame.

Raises:

PywaspError – If mesoclimate contains more than one independent height. Select one height or use point-specific height(point).

Notes

Run WAsP to perform the generalization to a geostrophic wind climate. The resulting geostrophic wind climate will have the same dimensions as the input bin_wind climate, except when n_sectors is specified with a different number of sectors than in the bwc.

See tutorial 9 for discussion of meridian convergence in generalization to geostrophic wind climates. Key points:

  • Input bwc must have grid-relative wind directions. The default rotate_to_true_north=False keeps the GeoWC in the input-grid reference frame and records that CRS in wind_dir_crs, which downscale_* uses to compute the minimal effective rotation automatically.

  • TopographyMap.get_site_effects() computes site effects with CRS information used on-the-fly for meridian convergence correction.

  • Set rotate_to_true_north=True to rotate the BWC to true north during generalisation; the GWC will store the geodetic (geographic) CRS WKT in wind_dir_crs and downscale_* will use the natural output-site MC directly.

  • This is an experimental function; for operational workflows, use predict_bwc() or predict_wwc() instead.