pywasp.wasp.downscale#

pywasp.wasp.downscale(gwc, topo_map, output_locs, conf=None, interp_method='nearest', mesoclimate=None, mesoclimate_interp_method='nearest', return_site_effects=False, add_met=True, cfd_volume=None, align_direction_crs=True)[source]#

Calculate site_effects, downscaled wind climate, and meteorlogical fields in a single step

Parameters:
  • gwc (xarray.Dataset) – Generalized wind climate xr.Dataset to downscale.

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

  • output_locs (xarray.Dataset) – Locations to calculate at created using create_dataset

  • conf (Config) – Configuration information from WAsP

  • interp_method (str, optional) – String indicating interpolation method, by default “nearest”. Options are {“nearest”, “linear”, “natural”, “given”}. If “given”, the function will not interpolate the generalized wind climate, but requires that the gwc and output_locs have the same spatial structure. If “nearest”, it will use the nearest neighbor interpolation. If “linear”, it will use linear interpolation. If “natural”, it will use natural neighbor interpolation.

  • 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) – Include the site_effects in the output?

  • add_met (bool) – Calculate and include meteorlogical fields from add_met_fields in the output?

  • cfd_volume (xarray.Dataset or list of xarray.Datasets, default None) – WAsP CFD volume xarray dataset that is used for obtaining site effects

  • align_direction_crs (bool, optional) – Whether to apply the grid-convergence direction correction at the output locations. When True (default) and the gwc carries a wind_dir_crs attribute (set by generalize_from_site_effects or generalize), the effective convergence is computed automatically. When False, no direction rotation is applied.

Returns:

xarray.Dataset – PyWAsP formated xr.Dataset containing sectorwise A, k, frequency, total A and k at site. Optionally include speedups, rix, elevation and other site_effects, and/or wind speeds, air and power densities.

Raises:

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

Notes

Run WAsP’s fortran downscale function to perform the “down” part of the WAsP framework. This will take the generalized data and convert it to a site specific weibull distribution based on the local conditions.

See tutorial 9 for an in-depth discussion of meridian convergence and direction reference frames. For this function:

  • When the gwc was produced by generalize_from_site_effects (or generalize), it carries a wind_dir_crs attribute that records its reference frame. align_direction_crs=True uses this to minimise direction errors when input and output are in different projections.

  • The output wind climates are always grid-relative. The meridian convergence is defined positive for a clockwise rotation. It is added in the generalization step and subtracted in the downscaling step.