pixel_hierarchy
aggregate_climate_to_hierarchy(data: pd.DataFrame, hierarchy: pd.DataFrame) -> pd.DataFrame
Create all aggregate climate values for a given hierarchy from most-detailed data.
Parameters
data The most-detailed climate data to aggregate. hierarchy The hierarchy to aggregate the data to.
Returns
pd.DataFrame The climate data with values for all levels of the hierarchy.
Source code in src/idd_forecast_mbp/map_to_admin_2/pixel_hierarchy.py
load_subset_hierarchy(subset_hierarchy: str) -> pd.DataFrame
Load a subset location hierarchy.
The subset hierarchy might be equal to the full aggregation hierarchy, but it might also be a subset of the full aggregation hierarchy. These hierarchies are used to provide different views of aggregated climate data.
Parameters
subset_hierarchy The administrative hierarchy to load (e.g. "gbd_2021")
Returns
pd.DataFrame The hierarchy data with parent-child relationships
Source code in src/idd_forecast_mbp/map_to_admin_2/pixel_hierarchy.py
post_process(df: pd.DataFrame, pop_df: pd.DataFrame) -> pd.DataFrame
Rename 000 to {summary_covariate}_per_capita Merge in population Create {summary_covariate}_capita*population -> {summary_covariate}