geodata.wind.extrapolate_wind_speed
===================================

.. py:function:: geodata.wind.extrapolate_wind_speed(ds, to_height, extrap_fn=log_ratio, from_height=None, var_height=None)

   Extrapolate the wind speed from a given height above ground to another.

   If ds already contains a key refering to wind speeds at the desired to_height,
   no conversion is done and the wind speeds are directly returned.

   Otherwise, extrapolates according to (1) extrap_fn and (2) heights



   :param ds: Dataset containing the wind speed time-series
   :type ds: xarray.Dataset
   :param to_height: Height (m) to which the wind speeds are extrapolated
   :type to_height: int|float
   :param extrap_fn: log_ratio : wind speed follows the logarithmic ratio law as desribed in [1]
                     log_law : wind speed follows logarithmic (integration) law described in [3]
                     power_law : wind speed follows power law (with fixed alpha), e.g., in [4]
   :type extrap_fn: function for wind speed extrapolation
   :param from_height: (Optional)
                       Height (m) from which the wind speeds are interpolated to 'to_height'.
                       If not provided, the closest height to 'to_height' is selected.
   :type from_height: int
   :param var_height: (Optional)
                      suffix of variables in ds corresponding to variable height
                      e.g., `lml` => height contained in `hlml`, wind speed contained in `wndlml`
   :type var_height: str

   :returns: **da** -- DataArray containing the extrapolated wind speeds. Name of the DataArray
             is 'wnd{to_height:d}'.
   :rtype: xarray.DataArray

   .. rubric:: References

   [1] Equation (2) in Andresen, G. et al (2015):
           'Validation of Danish wind time series from a new global renewable
           energy atlas for energy system analysis'.
   [2] https://en.wikipedia.org/w/index.php?title=Roughness_length&oldid=862127433,
           Retrieved 2019-02-15.
   [3] S. Emeis, Wind Energy Meteorology (Springer, Berlin, 2013).
   [4] Archer, C.L., Jacobson, M.Z., 2005. Evaluation of global wind power.
           Journal of Geophysical Research 110, D12110.

