pywasp.wasp.downscale_from_geostrophic_and_site_effects_to_bwc#
- pywasp.wasp.downscale_from_geostrophic_and_site_effects_to_bwc(geowc, site_effects, conf=None, interp_method='nearest', mesoclimate=None, mesoclimate_interp_method='nearest', return_site_effects=False, add_met=False, bin_width=1.0, n_wsbins_out=None, align_direction_crs=True, allow_truncation=False)[source]#
Downscale a geostrophic wind climate using precalculated site effects
Warning
This function is experimental and its signature may change.
- Parameters:
geowc (
xarray.Dataset) – Geostrophic wind climate to downscalesite_effects (
xarray.Dataset) – Site effects dataset created from TopographyMap.get_site_effects or TopographyMap.rose_to_site_effects.conf (
Config) – Configuration information from WAsPinterp_method (
str, optional{'nearest', 'given'}) – String indicating interpolation method, by default ‘given’.mesoclimate (
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 dataadd_met (
bool, optional) – If True, add meteorological fields to the wind climate datan_wsbins_out (
int, optional) – Number of bins in the output wind speed histogram. Defaults to 100.allow_truncation (
bool, defaultFalse) – If False, raiseCoreErrorwhen the output histogram is too short. If True, warn and return the raw, subnormalizedwsfreqinstead. Requiresadd_met=False.align_direction_crs (
bool, optional) – Whether to apply the grid-convergence direction correction. WhenTrue(default) and thegeowchas awind_dir_crsattribute (set bygeneralize_from_site_effects_to_geowc), the effective convergence is computed automatically from the CRS. WhenFalse, no direction rotation is applied at the output site.
- Returns:
xarray.Dataset– PyWAsP formated xr.Dataset containing a weibull wind climate- Raises:
PywaspError – If
mesoclimatecontains more than one independent height. Select one height or use point-specificheight(point).
Notes
This will take a geostrophic binned wind climate and convert it to a site specific weibull distribution based on the local conditions.
See tutorial 9 for discussion of meridian convergence handling in downscaling from geostrophic wind climates. Key points:
The site-effects dataset’s CRS is used to compute meridian convergence on-the-fly from the
geowc’swind_dir_crsattribute.align_direction_crs=True(default) auto-computes the effective convergence from thegeowc’s storedwind_dir_crsattribute.This is an experimental function; for operational workflows, use
predict_bwc()instead. Meridian convergence is defined positive for a clockwise rotation, so it is added in the generalization step and subtracted in the downscaling step.