Add hourly heating and cooling degree hours

Aperta
#552 1 commento 1 reazione 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@yerbol-akhmetov ci sta già lavorando.

Dal 25/11/2026.

  • #553 di @yerbol-akhmetov — aperta

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

status: in progress type: enhancement

Detailed Description

atlite provides Cutout.heat_demand() and Cutout.cooling_demand(), which compute degree days from the daily mean temperature. These work well for daily demand profiles.

I propose adding two complementary functions that compute degree hours from the hourly temperature of the cutout. This gives users an option when they need the variation within a day:

  • Cutout.heating_degree_hours(threshold=15, a=1, constant=0): max(0, a·(threshold − T)) + constant
  • Cutout.cooling_degree_hours(threshold=23, a=1, constant=0): max(0, a·(T − threshold)) + constant

The existing functions stay unchanged. As in the daily functions, the threshold is applied per grid cell before spatial aggregation. All convert_and_aggregate arguments (matrix, layout, shapes, aggregate_time, …) are supported. Defaults mirror the daily functions.

Context

We are planning to add space cooling to PyPSA-Eur. For this, we would need the hourly shape of cooling demand, which typically peaks in the afternoon. Hourly degree hours could be computed in PyPSA-Eur through a custom convert_func, but having them in atlite would make them available to other users and models, for heating as well.

Possible Implementation

Add convert_heating_degree_hours / heating_degree_hours and convert_cooling_degree_hours / cooling_degree_hours to atlite/convert.py, register them on Cutout, and follow the structure of the existing degree-day functions, using hourly instead of daily mean temperature.

An alternative would be a resolution argument (e.g. freq) on the existing functions. Separate functions keep the current API and results as they are.

The threshold stays a user-defined parameter, so it can differ by region or country. Users can aggregate the hourly result to a coarser resolution or smooth it for building thermal inertia afterwards.

A humidity-aware variant could be a follow-up, for example enthalpy-based degree hours using the 2 m dewpoint temperature already available in ERA5 cutouts. This would capture the latent cooling load.
I'm happy to open a PR.

Lingua principale
Python
Stelle
416
Fork
136
Merge medio
4g 2h
PR unite (30g)
8

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PyPSA/atlite

Tutte le issue di PyPSA/atlite

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.