pywasp.wasp.downscale_from_site_effects#
- pywasp.wasp.downscale_from_site_effects(gwc, site_effects, **kwargs)[source]#
Downscale a wind climate using site effects data.
This function automatically selects the appropriate downscaling method based on the type of wind climate provided. For geostrophic wind climates, it uses geostrophic-specific downscaling; for generalized wind climates, it uses standard generalized wind climate downscaling.
- Parameters:
gwc (
xarray.Dataset) – Wind climate dataset to downscale. Can be either a geostrophic wind climate (GeoWC) or generalized wind climate (GWC).site_effects (
xarray.Dataset) – Site effects dataset created from TopographyMap.rose_to_site_effects or TopographyMap.get_site_effects containing topographic effects data.**kwargs (
dict) – Arbitrary keyword arguments passed to the underlying downscaling function. Parameters include:- confpywasp.wasp.Config, optional
Configuration information from WAsP. If None, a default Config() is used.
- interp_methodstr, optional
Interpolation method for spatial interpolation. Default is “nearest”. Options are {“nearest”, “linear”, “natural”, “given”}.
- mesoclimatexarray.Dataset, optional
Mesoclimate data for downscaling. If None, CFSR reanalysis is used.
- mesoclimate_interp_methodstr, optional
Interpolation method for mesoclimate. Default is “nearest”.
- return_site_effectsbool, optional
Whether to include site effects in output. Default is False.
- add_metbool, optional
Whether to add meteorological fields to output. Default is False.
- align_direction_crsbool, optional
Whether to apply the grid-convergence direction correction.
True(default) enables automatic effective-convergence computation.Falseskips any direction rotation.
- Returns:
xarray.Dataset– Downscaled wind climate dataset containing site-specific Weibull parameters (A, k) and wind direction frequencies. The wwc structure includes:A : Weibull scale parameter
k : Weibull shape parameter
wdfreq : Wind direction frequency
- Raises:
PywaspError – If
mesoclimatecontains more than one independent height. Select one height or use point-specificheight(point).
Notes
This is a dispatcher function that determines the wind climate type using
is_geowc()and calls the appropriate specialized downscaling function:For geostrophic wind climates:
_downscale_from_geostrophic_and_site_effects_to_wwcFor generalized wind climates:
_downscale_from_gwc_and_site_effects_to_wwc
See tutorial 9 for an in-depth discussion of meridian convergence, direction reference frames, and how downscaling handles both true-north-relative and grid-relative wind directions. Key takeaways:
For single-projection and cross-projection workflows, leave
align_direction_crs=True(default). The effective convergence between input and output projections is computed automatically.Pass
align_direction_crs=Falseto skip direction rotation entirely.
Examples
>>> # Downscale a geostrophic wind climate >>> result = downscale_from_site_effects(geowc, site_effects, conf=config)
>>> # Downscale a generalized wind climate with custom interpolation >>> result = downscale_from_site_effects(gwc, site_effects, ... interp_method="linear")
>>> # Include site effects and meteorological fields in output >>> result = downscale_from_site_effects(gwc, site_effects, ... return_site_effects=True, ... add_met=True)