pacificclimate / weather-anomaly-tool

0 stars 0 forks source link

Correct the marker-colouring algorithm #44

Closed rod-glover closed 6 years ago

rod-glover commented 6 years ago

The current marker colouring algorithm is almost certainly not what we should ultimately be using. Consult Faron Anslow for guidance.

rod-glover commented 6 years ago

Temperature anomaly mapping:

-20 5:48:97 -5 5:48:97 -3 67:147:195 -1 209:229:240 -0.01 240:240:240 0.0 240:240:240 1 253:219:199 3 214:96:77 5 103:0:31 20 103:0:31

where the first number is the anomaly value (deg C), and the second is a color in format R:G:B

rod-glover commented 6 years ago

Precip anomaly mapping:

-150 102:37:6 -100 102:37:6 -50 254:196:79 -0.1 240:240:240 0 240:240:240 50 173:221:142 100 65:171:93 150 0:104:55 1000 0:69:41

where the first number is the relative anomaly (see below, and the second is a color in format R:G:B

Relative anomaly:

D_ann <- 100*((var_annmean/var_climo_annmean) - 1)

So, it's observed value divided by the baseline value minus 1 all multiplied by 100 to bring it to percent. This should give a minimum possible value of -100 and an unlimited upper limit and the case where the observed precipitation matches the baseline climatology will yield a zero.