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 generalizedsite_effects (
xarray.Dataset) – Site effects datasetconf (
Config) – PyWAsP configuration objectmesoclimate (
xarray.Dataset, optional) – Mesoclimate at the site locations, e.g. frompywasp.wasp.get_climate(). If None, it is looked up from the sources selected byconf, usingmesoclimate_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_climateon 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 dataas_wv_count (
bool) – return the wind climate as a wv_count object or as a standard binned wind climaten_gbins (
int, optional) – Number of bins for the wind speed distribution, by default 500rotate_to_true_north (
bool, optional) – Whether to rotate the input BWC wind directions from the projected grid reference frame to true north before generalizing. WhenFalse(default), no rotation is applied; the output GeoWC is in the input-grid reference frame and itswind_dir_crsattribute stores the CRS WKT of that projection so a subsequentdownscale_*call can compute the effective rotation automatically. WhenTrue, the meridian convergence attached byget_site_effectsis used to rotate the BWC to true north; the output GeoWC stores the geodetic (geographic) CRS WKT in thewind_dir_crsattribute (true-north reference frame).
- Returns:
geo_wc (
xarray.Dataset) – PyWAsP geostrophic wind climate. Always contains awind_dir_crsattribute 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
mesoclimatecontains more than one independent height. Select one height or use point-specificheight(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
bwcmust have grid-relative wind directions. The defaultrotate_to_true_north=Falsekeeps the GeoWC in the input-grid reference frame and records that CRS inwind_dir_crs, whichdownscale_*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=Trueto rotate the BWC to true north during generalisation; the GWC will store the geodetic (geographic) CRS WKT inwind_dir_crsanddownscale_*will use the natural output-site MC directly.This is an experimental function; for operational workflows, use
predict_bwc()orpredict_wwc()instead.