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 downscale

  • site_effects (xarray.Dataset) – Site effects dataset created from TopographyMap.get_site_effects or TopographyMap.rose_to_site_effects.

  • conf (Config) – Configuration information from WAsP

  • interp_method (str, optional {'nearest', 'given'}) – String indicating interpolation method, by default ‘given’.

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

  • align_direction_crs (bool, optional) – Whether to apply the grid-convergence direction correction. When True (default) and the geowc has a wind_dir_crs attribute (set by generalize_from_site_effects_to_geowc), the effective convergence is computed automatically from the CRS. When False, no direction rotation is applied at the output site.

Returns:

xarray.Dataset – PyWAsP formated xr.Dataset containing a weibull wind climate

Raises:

PywaspError – If mesoclimate contains more than one independent height. Select one height or use point-specific height(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’s wind_dir_crs attribute.

  • align_direction_crs=True (default) auto-computes the effective convergence from the geowc’s stored wind_dir_crs attribute.

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