geodata.convert.heat_demand#
- geodata.convert.heat_demand(cutout, threshold=15.0, a=1.0, constant=0.0, hour_shift=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.
- Parameters:
threshold (float) – Outside temperature in degrees Celsius above which there is no heat demand.
a (float) – Linear factor relating heat demand to outside temperature.
constant (float) – Constant part of heat demand that does not depend on outside temperature (e.g. due to water heating).
hour_shift (float) – Time shift relative to UTC for taking daily average
Note
You can also specify all of the general conversion arguments documented in the convert_cutout function.