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.

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

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_wwc

  • For generalized wind climates: _downscale_from_gwc_and_site_effects_to_wwc

Examples

>>> # Downscale a geostrophic wind climate
>>> result = downscales_from_site_effects(geowc, site_effects, conf=config)
>>> # Downscale a generalized wind climate with custom interpolation
>>> result = downscales_from_site_effects(gwc, site_effects,
...                                      interp_method="linear")
>>> # Include site effects and meteorological fields in output
>>> result = downscales_from_site_effects(gwc, site_effects,
...                                      return_site_effects=True,
...                                      add_met=True)