cerfacs-globc / icclim

icclim: Python library for climate indices and climate indicators calculation.
https://icclim.readthedocs.io/en/latest/
Apache License 2.0
84 stars 32 forks source link

ENH: Add `units_metadata` attribute to the output of temperature based indices #297

Open bzah opened 10 months ago

bzah commented 10 months ago

Description

CF has added a units_metadata attribute that is used to differentiate a difference of temperatures and a on scale temperature. See: units_metadata https://github.com/cf-convention/vocabularies/issues/172

The temperature: difference concerns mainly DTR, vDTR, ETR but also some generic indices. The other indices should still set this attribute but should set temperature: on-scale if they are computed on temperatures.

As for the input of icclim, either we assume it's always temperature: on-sclae daily data (or whatever frequency) or we add a check for this units_metadata but it won't be filled for existing datasets.