ecmwf / thermofeel

thermofeel is a library to calculate human thermal comfort indexes
Apache License 2.0
67 stars 19 forks source link

Parameter Units for calculate_mean_radiant_temperature, return value of calc cza integrated #24

Closed jarataraj closed 2 years ago

jarataraj commented 2 years ago

The example code calc_utci.py and utci_wbgt.py deaccumulate ssrd, ssr, fdir, strd, and strr, which leads me to believe the units for these arguments should be fluxes (W/m^2 or J/sm^2) rather than accumulated radiation as stated in the docstring (J/m^2 or Jm^-2). From what I can tell, the Di Napoli paper says the MRT calculation is done with surface fluxes, not accumulated radiation.

Additionally, the docstring for calculate_cos_solar_zenith_angle_integrated says: returns average of cosine of the solar zenith angle during interval [degrees], but the example code in calc_utci.py and utci_wbgt.py "deaccumulate" the value returned by this function as well, which leads me to believe that calculate_cos_solar_zenith_angle_integrated returns the integral of the cos solar zenith angle over a period over time, rather than the average cza during the interval. I'm not familiar enough with the math used to answer this for myself.

To summarize:

  1. Are the units for ssrd, ssr, fdir, strd, strr in calculate_mean_radian_temperature supposed to be W/m^2, and incorrectly labelled as J/m^2?
  2. Does calculate_cos_solar_zenith_angle_integrated return the integral of cza over a period or the average cza over a period?

I am new to this so please correct me if I am wrong. Thank you for your help!!

tlmquintino commented 2 years ago

The units of ssrd, ssr, fdir, strd, and strr as produced from (for example the ECMWF forecast) are (J m-2) as in this reference parameter database https://apps.ecmwf.int/codes/grib/param-db/?id=176

Then, as documented in that page, to obtain fluxes, you need to divided by the accumulation period expressed in seconds. This means that the thermofeel function calculate_mean_radiant_temperature takes in (W m-2).

So the documentation string is wrong and needs to be corrected.

tlmquintino commented 2 years ago

This should have now been fixed in the development branch and will be present in version 1.3.0