geodata.model.wind.WindExtrapolationModel
=========================================

.. toctree::
   :hidden:

   /autoapi/geodata/model/wind/WindExtrapolationModel.estimate
   /autoapi/geodata/model/wind/WindExtrapolationModel.extract_dataset_metadata
   /autoapi/geodata/model/wind/WindExtrapolationModel.extract_cutout_metadata
   /autoapi/geodata/model/wind/WindExtrapolationModel.prepare

.. py:class:: geodata.model.wind.WindExtrapolationModel(source: Union[geodata.Dataset, geodata.Cutout], **kwargs)



   Wind speed estimation based on the an extrapolation model.

   Model Details:
       The wind speed is estimated using a linear regression of the logarithm of the wind speed
       against the logarithm of the height. The coefficients of the regression are stored in the
       dataset as a 2D array of shape (2,). The first coefficient is the slope of the regression
       line, and the second coefficient is the intercept. The wind speed is then estimated as
       :math:`\hat{v} = \alpha \cdot \log(z) + \beta`, where :math:`\alpha` and :math:`\beta`
       are the coefficients, and :math:`z` is the height.

   Residuals:
       The residuals of the regression are stored in the dataset as a 2D array of shape (n,).
       The residuals are the difference between the estimated wind speed and the actual wind speed.
       The residuals are stored in the same order as the heights used in the regression.

   :param source: Dataset or Cutout object this model is based on.
   :type source: Dataset | Cutout

   .. rubric:: Example

   >>> from geodata import Dataset
   >>> from geodata.model.wind import WindExtrapolationModel
   >>> dataset = Dataset(module="merra2", weather_data_config="slv_flux_hourly", years=slice(2010, 2010), months=slice(1,2))
   >>> model = WindExtrapolationModel(dataset)
   >>> model.prepare()
   >>> model.estimate(height=12, xs=slice(1, 2), ys=slice(1, 2), years=slice(2010, 2010), months=slice(1, 2))


   .. py:attribute:: SUPPORTED_WEATHER_DATA_CONFIGS


   .. py:attribute:: type
      :type:  str
      :value: 'wind'


      Type of the model.


   .. py:attribute:: metadata_keys
      :type:  set[str]


   .. py:attribute:: source


   .. py:property:: name
      :type: str

      Name of the model.


   .. py:property:: module
      :type: str

      Module of the model.


   .. py:property:: prepared
      :type: bool

      Check if the model is prepared.

      :returns: True if prepared.
      :rtype: bool


   .. py:property:: from_dataset
      :type: bool

      Check if the model is from a dataset.


   .. py:property:: files

Methods
-------

.. autoapisummary::

   geodata.model.wind.WindExtrapolationModel.estimate
   geodata.model.wind.WindExtrapolationModel.extract_dataset_metadata
   geodata.model.wind.WindExtrapolationModel.extract_cutout_metadata
   geodata.model.wind.WindExtrapolationModel.prepare


