What I'm trying to do is calculate anomalies between a "current" period (mean values for 2004:2015) and a "baseline" period (1961-1990 normals), for Tmin coldest month, Tmax warmest month, climate water deficit (perhaps summed over the year), etc.
So for example, to calculate the anomaly for Tmin coldest month, for each site I need to calculate:
mean(Tmin.Jan), mean(Tmin.Feb), etc., across 2004-2015
the min. value from 1 (since we don't know which month is the coldest)
The min value of (Tmin.Jan., Tmin.Feb, etc.) from 1961-1990 normals
difference between 2 and 3
I think there are two approaches for this - a raster and a point based solution. The raster approach is simpler I find but will provide both for comparison:
Question from email:
What I'm trying to do is calculate anomalies between a "current" period (mean values for 2004:2015) and a "baseline" period (1961-1990 normals), for Tmin coldest month, Tmax warmest month, climate water deficit (perhaps summed over the year), etc.
So for example, to calculate the anomaly for Tmin coldest month, for each site I need to calculate:
I think there are two approaches for this - a raster and a point based solution. The raster approach is simpler I find but will provide both for comparison:
Get Data for 100 random pts in Colorado ...
Site based approach
Raster Based approach
Check for agreement
Created on 2021-03-10 by the reprex package (v0.3.0)