cedar.metrics.cdd¶
cedar.metrics.cdd¶
Cooling Degree Days (CDD) helper.
Computes per-hour degree exceedance above a base temperature. This is a simple utility: given ambient temperatures, it returns the positive difference from the base (°K) and zero otherwise. Daily/monthly aggregation is left to callers (xarray resampling, summing, etc.).
Example
>>> cdd = CoolingDegreeDays(base_temperature_K=18.0 + 273.15)
>>> cdd.exceedance([290.0, 293.0, 296.0]) # mix of below/above base
array([0. , 1.85, 4.85])
>>> cdd.exceedance([270.0, 273.0]) # below base → zeros
array([0., 0.])
Classes
|
Compute hourly CDD exceedance against a base temperature. |