weather.derived.heating_degree_hours(temperature, base=DEFAULT_HDH_BASE_C)
Heating degree-hours :math:\max(base - T, 0).
Parameters
| temperature |
pd.Series |
Hourly air temperature in °C. |
required |
| base |
float |
Heating base temperature in °C. Defaults to 15.0. |
DEFAULT_HDH_BASE_C |
Returns
|
pd.Series |
pd.Series: hdh per timestamp, float64, same index as |
|
pd.Series |
temperature. Zero whenever it is warmer than base. |
Raises
|
ValueError |
If temperature is not a NaN-free numeric Series. |
Examples
import pandas as pd
from spotforecast2_safe.weather.derived import heating_degree_hours
t = pd.Series([5.0, 15.0, 25.0])
print(heating_degree_hours(t, base=15.0).tolist())