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 modeloutput_locs (
xarray.Dataset) – Locations to calculate at created using create_datasetconf (
Config) – Configuration information from WAsPinterp_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 thegwcandoutput_locshave 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. 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) – 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.Datasetorlistofxarray.Datasets, defaultNone) – WAsP CFD volume xarray dataset that is used for obtaining site effectsalign_direction_crs (
bool, optional) – Whether to apply the grid-convergence direction correction at the output locations. WhenTrue(default) and thegwccarries awind_dir_crsattribute (set bygeneralize_from_site_effectsorgeneralize), the effective convergence is computed automatically. WhenFalse, 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
mesoclimatecontains more than one independent height. Select one height or use point-specificheight(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
gwcwas produced bygeneralize_from_site_effects(orgeneralize), it carries awind_dir_crsattribute that records its reference frame.align_direction_crs=Trueuses 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.