act.utils.ts_weighted_average

act.utils.ts_weighted_average(ts_dict)[source]

Program to take in multiple difference time-series and average them using the weights provided. This assumes that the variables passed in all have the same units. Please see example gallery for an example.

NOTE: All weights should add up to 1

Parameters:

ts_dict (dict) – Dictionary containing datastream, variable, weight, and datasets

t_dict = {
    "sgpvdisC1.b1": {
        "variable": "rain_rate",
        "weight": 0.05,
        "ds": ds,
    },
    "sgpmetE13.b1": {
        "variable": [
            "tbrg_precip_total",
            "org_precip_rate_mean",
            "pwd_precip_rate_mean_1min",
        ],
        "weight": [0.25, 0.05, 0.0125],
    },
}
Returns:

data (numpy array) – Variable of time-series averaged data