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 generalized

  • topo_map (TopographyMap) – TopographyMap of the region to model

  • output_locs (xarray.Dataset) – Output locations in one of the windkit spatial structures (point, stacked_point, cuboid)

  • conf (Config, optional) – PyWAsP configuration object

  • n_sectors (int, optional) – Number of sector for which the terrain is analyzed. By default, the same number of sectors as the provided bwc

  • interp_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. 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.

  • output_mesoclimate (xarray.Dataset, optional) – Mesoclimate at the output 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

  • add_met (bool, optional) – If True, add meteorological fields to the wind climate data

  • n_wsbins_out (int, optional) – Number of bins in the output wind speed histogram, which spans 0 to n_wsbins_out * bin_width m/s. Defaults to 100.

  • allow_truncation (bool, default False) – If False, raise CoreError when the output histogram is too short. If True, warn and return the raw, subnormalized wsfreq instead. Requires add_met=False.

  • cfd_volume (xarray.Dataset or list of xarray.Datasets, default None) – 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 using get_site_effects.

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

  • align_direction_crs (bool, optional) – Whether to apply the grid-convergence direction correction. When True (default, recommended), the effective convergence between input and output projections is computed automatically, minimising sector-resampling losses. Pass False to 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_out bins of constant width bin_width, so it spans 0 to n_wsbins_out * bin_width m/s; the returned number of bins is the highest populated bin over all sectors. A too-short histogram raises CoreError unless allow_truncation=True; in that case the returned wsfreq is subnormalized and a warning is emitted.