Closed nikhil003 closed 2 years ago
Delta and tan(Delta) are computed instead of being hard-coded, resulting in slightly different results as tanDelta used before was a bad approximation. This will be consolidated in the upcoming version of the SPEI package. Resulting PET values are nearly identical, but the code is more clear and correct now.
We are currently using the SPEI package for calculating drought indicators in our project. While doing so, we realised a slight difference in the implementation of thornthwaite PET specifically how declination angle is used.
In Vicente-Serrano et. al. (2010), the equations are given as
which is then used in computing hourly angle of sun rising
However, when looking at the implementation in thornthwaite.R, we noticed
which is a vector of values though we assumed that it would be a vector of values. This is identified after verifying that the values assigned to are just values of .
Seeing that the equations for declination angle and hourly angle of sun rising are standard equations, it seems that there is a small implementation issue.