Add hourly heating and cooling degree hours

オープン
#552 コメント 1 件 リアクション 1 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@yerbol-akhmetov がすでに取り組んでいます。

2026年11月25日 から。

  • #553 @yerbol-akhmetov による — オープン

評価

この issue はまだ評価されていません。

説明

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.

主要言語
Python
スター
416
フォーク
136
平均マージ
4日 2時間
マージ済み PR(30日)
8

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

PyPSA/atlite のほかの issue

PyPSA/atlite の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。