geodata.Cutout.heat_demand
==========================

.. py:method:: geodata.Cutout.heat_demand(threshold: float = 15.0, a: float = 1.0, constant: float = 0.0, hour_shift: float = 0.0, **params)

   Convert outside temperature into daily heat demand using the
   degree-day approximation.

   Since "daily average temperature" means different things in
   different time zones and since xarray coordinates do not handle
   time zones gracefully like pd.DateTimeIndex, you can provide an
   hour_shift to redefine when the day starts.

   E.g. for Moscow in winter, hour_shift = 4, for New York in winter,
   hour_shift = -5

   This time shift applies across the entire spatial scope of ds for
   all times. More fine-grained control will be built in a some
   point, i.e. space- and time-dependent time zones.

   WARNING: Because the original data is provided every month, at the
   month boundaries there is untidiness if you use a time shift. The
   resulting xarray will have duplicates in the index for the parts
   of the day in each month at the boundary. You will have to
   re-average these based on the number of hours in each month for
   the duplicated day.

   :param threshold: Outside temperature in degrees Celsius above which there is no heat demand.
   :type threshold: float
   :param a: Linear factor relating heat demand to outside temperature.
   :type a: float
   :param constant: Constant part of heat demand that does not depend on outside
                    temperature (e.g. due to water heating).
   :type constant: float
   :param hour_shift: Time shift relative to UTC for taking daily average
   :type hour_shift: float

   :returns: Heat demand
   :rtype: xr.DataArray

   .. note::

      You can also specify all of the general conversion arguments
      documented in the `convert_cutout` function.

