climate_toolbox.aggregations package¶
Submodules¶
climate_toolbox.aggregations.aggregations module¶
-
climate_toolbox.aggregations.aggregations.
weighted_aggregate_grid_to_regions
(ds, variable, aggwt, agglev, weights=None)[source]¶ Computes the weighted reshape of gridded data
- Parameters
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)
- Returns
ds – weighted and averaged dataset based on agglev
- Return type
xr.Dataset