downscale.base
Downscaler interface and the generic proportional implementation.
Region→country and country→bus are the same operation: distribute a coarse value over
its finer members proportionally to proxy shares (population/GDP/SSP activity, ...).
The shares are built by :mod:iampypsa.downscale.proxy.
Downscaler
¶
Bases: ABC
Define how coarse values are distributed to finer units.
Source code in src/iampypsa/downscale/base.py
downscale(coarse, proxy_shares)
abstractmethod
¶
ProportionalDownscaler
¶
Bases: Downscaler
Distribute coarse values to finer units in proportion to proxy shares.
Source code in src/iampypsa/downscale/base.py
downscale(coarse, proxy_shares, *, coarse_id='region', fine_id='fine_id', share_col='share', value_col='value')
¶
Multiply each coarse value by its members' proxy shares.
proxy_shares has columns [coarse_id, fine_id, share] (shares summing to 1
within each coarse_id); returns the coarse frame re-keyed to fine_id with
value split by share.