Closed kpalmqui closed 1 year ago
Per our meeting: we will implement a function in ST_environs that will take a array of integers that represent months (0 = January, 11 = December), and calculate the proportion of precipitation of those months over the whole year.
An update here: for all climate variables used in the calculation of wildfire probability (proportion of total precipitation received in the summer, mean annual temperature, and annual precipitation), we want these to be based on 10-year running averages, not this year's annual values. get_running_mean
is likely to be helpful here.
typedef struct WildfireClimate_st {
double propSummerPrecip[10];
double propSummerPrecipAvg;
...
int count;
} WildfireClimate;
get_running_mean()
in generic.c in the soilwatt source code calculates a cumulative running mean rather than a simple moving average (average of past n values).count % 10
.WildfireClimate *wildfireClimate;
_getWildfireProbability()
will access this local value by using the update function and getting the members by wildfireClimate->propSummerPrecipAvg
The proportion of total precipitation received in the summer (June-August) needs to be calculated and stored for use in the new wildfire cheatgrass cycle implementation.
precipitation that occurs in June, July, August / total annual precipitation
Should range between 0 and 1.
See SXW->ppt_monthly (monthly precipitation) & SXW->ppt (total annual precipitation)