weighted_aggregate_grid_to_regions(ds, variable, aggwt, agglev, weights=None)¶
Computes the weighted reshape of gridded data
ds (xr.Dataset) – xarray Dataset to be aggregated. Must have ‘lat’ and ‘lon’ in the coordinates.
variable (str) – name of the variable to be aggregated
aggwt (str) – Weighting variable (e.g. ‘popwt’, ‘areawt’). This must be a column name in the weights file.
agglev (str) – Target regional aggregation level (e.g. ‘ISO’, ‘hierid’). This must be a column name in the weights file.
weights (str, optional) – Regional aggregation weights (default agglomerated-world-new BCSD segment weights)
ds – weighted and averaged dataset based on agglev
- Return type