pywasp.wasp.predict_bwc#
- pywasp.wasp.predict_bwc(bwc, topo_map, output_locs, conf=None, n_sectors=None, interp_method='nearest', input_mesoclimate=None, output_mesoclimate=None, mesoclimate_interp_method='nearest', return_site_effects=False, add_met=True, cfd_volume=None, bin_width=1.0, n_gbins=500, n_wsbins_out=None, align_direction_crs=True, allow_truncation=False)[source]#
Predict a binned wind climate from a binned wind climate using a topography map for given output locations
Warning
This function is experimental and its signature may change.
- Parameters:
bwc (
xarray.Dataset) – PyWAsP xr.Dataset containing wind climate to be generalizedtopo_map (
TopographyMap) – TopographyMap of the region to modeloutput_locs (
xarray.Dataset) – Output locations in one of the windkit spatial structures (point, stacked_point, cuboid)conf (
Config, optional) – PyWAsP configuration objectn_sectors (
int, optional) – Number of sector for which the terrain is analyzed. By default, the same number of sectors as the provided bwcinterp_method (
{"given", "nearest"}) – Interpolation method for site effects, by default ‘given’.input_mesoclimate (
xarray.Dataset, optional) – Mesoclimate at the input (binned wind climate) 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.output_mesoclimate (
xarray.Dataset, optional) – Mesoclimate at the output 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, which spans 0 ton_wsbins_out * bin_widthm/s. 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.cfd_volume (
xarray.Datasetorlistofxarray.Datasets, defaultNone) – WAsP CFD volume xarray dataset that is used for obtaining site effects. By default None, meaning the site effects are calculated using the linear BZ model usingget_site_effects.n_gbins (
int, optional) – Number of bins for the wind speed distribution, by default 500align_direction_crs (
bool, optional) – Whether to apply the grid-convergence direction correction. WhenTrue(default, recommended), the effective convergence between input and output projections is computed automatically, minimising sector-resampling losses. PassFalseto skip any direction rotation.
- Returns:
out_bwc (
xarray.Dataset) – PyWAsP binned wind climate for the locations provided in output_site_effects- Raises:
PywaspError – If an input or output mesoclimate contains more than one independent height. Select one height or use point-specific
height(point).
Notes
This function takes binned wind climates and predicts binned wind climates at other locations by first generalizing the input binned wind climate from local site effects (
input_site_effects) using the WAsP methodology and then dowscaling at other locations with provided local site effects (output_site_effects).The resulting wind climate will have the same number of sectors as the input binned wind climate, except when n_sectors is specified with a different number of sectors than in the bwc. The output histogram has
n_wsbins_outbins of constant widthbin_width, so it spans 0 ton_wsbins_out * bin_widthm/s; the returned number of bins is the highest populated bin over all sectors. A too-short histogram raisesCoreErrorunlessallow_truncation=True; in that case the returnedwsfreqis subnormalized and a warning is emitted.